Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any asset fee feature #10

Merged
merged 81 commits into from
Apr 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
b8a8cf5
allow transactions to be constructed with fees in any asset
JBetz Mar 12, 2024
59be413
Add global variable for sequentia mode
JBetz Mar 14, 2024
69c88f9
Reward transaction fees in coinbase
JBetz Mar 14, 2024
4d94964
Only allow any asset fee payments in sequentia mode
JBetz Mar 14, 2024
40ae64f
Remove irrelevant logic for sequentia coinbase payout
JBetz Mar 15, 2024
09464e1
Support fee payment with any asset in coin selection
JBetz Mar 20, 2024
de56f89
Enable overriding fee asset in sendtoaddress RPC
JBetz Mar 20, 2024
978c9f5
Add feeAsset parameter to fundrawtransaction
JBetz Mar 22, 2024
fb17181
Use exchange rates when valuating transactions in mempool
JBetz Mar 22, 2024
30fb47a
Simplify fee asset selection
JBetz Mar 25, 2024
39e10e4
Consolidate CTxMemPoolEntry constructors; add accessor for nFeeAmount
JBetz Mar 25, 2024
f42c43b
Update tests and benches
JBetz Mar 25, 2024
da85c87
Update dummy mempool entry in chain limit check
JBetz Mar 25, 2024
29eda0e
Add RPCs for getting and setting fee exchange rates
JBetz Mar 26, 2024
d725ddb
Remove expiry_timestamp and reference_asset parameters from setfeeexc…
JBetz Mar 26, 2024
d8e78d4
Recompute fees of mempool entries when exchange rates are updated
JBetz Mar 26, 2024
a7df414
Use coin control for determining fee asset when funding transactions
JBetz Mar 27, 2024
37c1bec
Rename exchange rate globals using bitcoin convention
JBetz Mar 27, 2024
5a6d8a6
Remove consensus check for multiple fee assets
JBetz Mar 27, 2024
21889bd
Fix return value documentation for CalculateExchangeValue and remove …
JBetz Mar 28, 2024
9c22ad1
Add option to load exchange rates from config file
JBetz Mar 28, 2024
3256939
Remove obsolete comment about rate scale
JBetz Mar 28, 2024
dc133e7
Flatten nested if
JBetz Mar 28, 2024
3573874
Rename asset -> fee_asset in createrawtransaction RPC
JBetz Mar 28, 2024
9741f1e
Use JSON rather than INI config file for asset exchange rates
JBetz Mar 28, 2024
3004132
Remove unnecessary vins from coinbase transaction
JBetz Mar 28, 2024
e91e986
Refactor exchange rate map into singleton class
JBetz Mar 29, 2024
bd12ccc
Add fee asset information to getransaction response
JBetz Mar 29, 2024
a4b815c
Document new feeasset field in listtransactions output
JBetz Mar 29, 2024
58b5b80
In funding RPCs, rename feeAsset to fee_asset for internal consistency
JBetz Mar 29, 2024
fc3f940
Update comment
JBetz Mar 29, 2024
510de1d
Rename whitelist file path argument to be consistent with other file …
JBetz Mar 29, 2024
366c715
Use data directory as base when given a relative path for asset white…
JBetz Mar 29, 2024
8e1cb38
Parse exchange weight values as 64-bit integers
JBetz Mar 29, 2024
1e32628
Comments and cleanup
JBetz Apr 1, 2024
61eb084
Clear exchange rate map before updating with RPC inputs
JBetz Apr 3, 2024
037bdfe
Fix feeMap construction, use fee amounts rather than values
JBetz Apr 3, 2024
db1a4c8
Remove unnecessary TODO, MAX_MONEY checks are already handled in http…
JBetz Apr 3, 2024
b56f757
Replace Sequentia mode with No Coin feature flag (g_con_sequentiamode…
JBetz Apr 4, 2024
24edaa7
Fix policy asset fees in coinbase and remove redundant nFees field in…
JBetz Apr 4, 2024
bc32539
Add chain parameter argument for enabling No Coin feature
JBetz Apr 4, 2024
f47fc0a
Only register exchange rates RPCs if No Coin feature is enabled. Also…
JBetz Apr 4, 2024
20c341f
Don't set policy asset when No Coin is enabled
JBetz Apr 4, 2024
7a3463d
Set coin control fee asset before first reference
JBetz Apr 4, 2024
ee51a77
Don't override fee asset for coin control unless No Coin is enabled
JBetz Apr 5, 2024
13bff66
coin control: make fee asset an optional to be consistent with other …
JBetz Apr 5, 2024
0bd85b4
Allow block subsidies when No Coin is enabled; refactor for code reuse
JBetz Apr 5, 2024
76f7348
Ensure there is at least one fee output in coinbase
JBetz Apr 8, 2024
52dab3b
Only add commit scripts once after fee outputs
JBetz Apr 8, 2024
ae4fcea
Don't add policy asset to fee map unless there are no other transacti…
JBetz Apr 8, 2024
f5fdf2e
sendtoaddress: When any fees is disabled, only use policy asset for fees
JBetz Apr 8, 2024
da607ca
Add and use server argument for enabling No Coin feature
JBetz Apr 8, 2024
e7e0b4a
Set policy asset to pegged asset even if No Coin is enabled to allow …
JBetz Apr 8, 2024
a149f4d
Remove redundant chain parameter
JBetz Apr 8, 2024
3131ebd
Show user input string rather than parse result in error message
JBetz Apr 9, 2024
6731f86
Convert setfeeexchangerates parameter to JSON
JBetz Apr 9, 2024
ed19ea8
Return user input string in asset parser error message
JBetz Apr 9, 2024
ed8bd33
Remove "rates" wrapper from exchangerates RPCs
JBetz Apr 9, 2024
418dc36
Clear exchangeratesmap before updating
JBetz Apr 9, 2024
a0bfce3
Fix exchange rate map reference
JBetz Apr 9, 2024
ab10284
Fix ExchangeRates singleton
Mixa84 Apr 9, 2024
b0606fe
Fix getfeeexchangerates response
JBetz Apr 10, 2024
48870bd
Only update fee rates after parsing
JBetz Apr 10, 2024
982acbf
Remove extra input form
JBetz Apr 10, 2024
1ac57e2
Fix coinbase transaction creation
JBetz Apr 11, 2024
6ed5561
Use auto and reference
Mixa84 Apr 12, 2024
a5dc5d0
Merge branch 'feature/any_asset_test'
Mixa84 Apr 12, 2024
4d9f2e9
Clean up includes
JBetz Apr 12, 2024
cb0b901
Reuse COIN constant for exchange rate scale
JBetz Apr 12, 2024
c293556
Formatting: add space after if
JBetz Apr 12, 2024
387eed9
Documentation: remove Sequentia references and explain in terms of co…
JBetz Apr 12, 2024
f1473e6
Formatting: remove extra line
JBetz Apr 12, 2024
15f8801
Only set coin control fee asset when any asset fees is enabled
JBetz Apr 12, 2024
f6f02e5
Use %s instead of %ld when logging fee map
JBetz Apr 12, 2024
bbd655f
Restore exclusive lock for ClearPriorisation
JBetz Apr 12, 2024
12c6d6a
Remove invalid const
JBetz Apr 12, 2024
578edb6
Use camlCase for local variable names
JBetz Apr 12, 2024
65ffeb0
Add comment and TODO about fee_map assumptions
JBetz Apr 12, 2024
8929a05
Add sanity test for getfeeexchangerates
JBetz Apr 12, 2024
6c5b8de
getfeeexchangerates: use asset labels rather than hexes when possible
JBetz Apr 12, 2024
51d8b3c
Add more tests for getfeeexchangerates
JBetz Apr 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ BITCOIN_CORE_H = \
deploymentinfo.h \
deploymentstatus.h \
dynafed.h \
exchangerates.h \
external_signer.h \
flatfile.h \
fs.h \
Expand Down Expand Up @@ -355,6 +356,7 @@ libbitcoin_node_a_SOURCES = \
dynafed.cpp \
dbwrapper.cpp \
deploymentstatus.cpp \
exchangerates.cpp \
flatfile.cpp \
httprpc.cpp \
httpserver.cpp \
Expand Down Expand Up @@ -390,6 +392,7 @@ libbitcoin_node_a_SOURCES = \
primitives/pak.cpp \
rest.cpp \
rpc/blockchain.cpp \
rpc/exchangerates.cpp \
rpc/mining.cpp \
rpc/misc.cpp \
rpc/net.cpp \
Expand Down
2 changes: 1 addition & 1 deletion src/bench/mempool_eviction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ static void AddTx(const CTransactionRef& tx, const CAmount& nFee, CTxMemPool& po
LockPoints lp;
std::set<std::pair<uint256, COutPoint>> setPeginsSpent;
pool.addUnchecked(CTxMemPoolEntry(
tx, nFee, nTime, nHeight,
tx, nFee, ::policyAsset, nFee, nTime, nHeight,
spendsCoinbase, sigOpCost, lp, setPeginsSpent));
}

Expand Down
2 changes: 1 addition & 1 deletion src/bench/mempool_stress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ static void AddTx(const CTransactionRef& tx, CTxMemPool& pool) EXCLUSIVE_LOCKS_R
unsigned int sigOpCost = 4;
std::set<std::pair<uint256, COutPoint>> setPeginsSpent;
LockPoints lp;
pool.addUnchecked(CTxMemPoolEntry(tx, 1000, nTime, nHeight, spendsCoinbase, sigOpCost, lp, setPeginsSpent));
pool.addUnchecked(CTxMemPoolEntry(tx, 1000, ::policyAsset, 1000, nTime, nHeight, spendsCoinbase, sigOpCost, lp, setPeginsSpent));
}

struct Available {
Expand Down
2 changes: 1 addition & 1 deletion src/bench/rpc_mempool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ static void AddTx(const CTransactionRef& tx, const CAmount& fee, CTxMemPool& poo
{
LockPoints lp;
std::set<std::pair<uint256, COutPoint> > setPeginsSpent;
pool.addUnchecked(CTxMemPoolEntry(tx, fee, /*time=*/0, /*entry_height=*/1, /*spends_coinbase=*/false, /*sigops_cost=*/4, lp, setPeginsSpent));
pool.addUnchecked(CTxMemPoolEntry(tx, fee, ::policyAsset, fee, /*time=*/0, /*entry_height=*/1, /*spends_coinbase=*/false, /*sigops_cost=*/4, lp, setPeginsSpent));
}

static void RpcMempool(benchmark::Bench& bench)
Expand Down
62 changes: 62 additions & 0 deletions src/exchangerates.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#include <assetsdir.h>
#include <exchangerates.h>
#include <policy/policy.h>
#include <univalue.h>

#include <fstream>

CAmount ExchangeRateMap::CalculateExchangeValue(const CAmount& amount, const CAsset& asset) {
auto it = this->find(asset);
if (it == this->end()) {
return 0;
}
auto scaled_value = it->second.m_scaled_value;
__uint128_t value = ((__uint128_t)amount * (__uint128_t)scaled_value) / (__uint128_t)exchange_rate_scale;
if (value > UINT64_MAX) {
return UINT64_MAX;
} else {
return (uint64_t) value;
}
}

bool ExchangeRateMap::LoadExchangeRatesFromJSONFile(fs::path file_path, std::string& error) {
// Read config file
std::ifstream ifs(file_path);
if (!ifs.is_open()) {
error = "Failed to open file";
return false;
}
std::stringstream buffer;
buffer << ifs.rdbuf();

// Parse as JSON
std::string rawJson = buffer.str();
UniValue json;
if (!json.read(rawJson)) {
error = "Cannot parse JSON";
return false;
}
std::map<std::string, UniValue> assetMap;
json.getObjMap(assetMap);

// Load exchange rates into map
this->clear();
for (auto assetEntry : assetMap) {
auto assetIdentifier = assetEntry.first;
auto assetData = assetEntry.second;
CAsset asset = GetAssetFromString(assetIdentifier);
if (asset.IsNull()) {
error = strprintf("Unknown label and invalid asset hex: %s", assetIdentifier);
return false;
}
CAmount exchangeRateValue;
if (assetData.isNum()) {
exchangeRateValue = assetData.get_int64();
} else {
error = strprintf("Invalid value for asset %s: %d", assetIdentifier, assetData.getValStr());
return false;
}
(*this)[asset] = exchangeRateValue;
}
return true;
}
53 changes: 53 additions & 0 deletions src/exchangerates.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@

#ifndef BITCOIN_EXCHANGERATES_H
#define BITCOIN_EXCHANGERATES_H

#include <fs.h>
#include <policy/policy.h>

constexpr const CAmount exchange_rate_scale = COIN;

class CAssetExchangeRate
{
public:
/** Fee rate. */
CAmount m_scaled_value;

CAssetExchangeRate() : m_scaled_value(0) { }
CAssetExchangeRate(CAmount amount) : m_scaled_value(amount) { }
CAssetExchangeRate(uint64_t amount) : m_scaled_value(amount) { }
};

class ExchangeRateMap : public std::map<CAsset, CAssetExchangeRate>
{
private:
ExchangeRateMap() {}
ExchangeRateMap(const CAmount& default_asset_rate) {
(*this)[::policyAsset] = default_asset_rate;
}
public:
static ExchangeRateMap& GetInstance() {
static ExchangeRateMap instance(exchange_rate_scale); // Guaranteed to be destroyed and instantiated only once
return instance;
}

/**
* Calculate the exchange value
*
* @param[in] amount Corresponds to CTxMemPoolEntry.nFeeAmount
* @param[in] asset Corresponds to CTxMemPoolEntry.nFeeAsset
* @return the value at current exchange rate. Corresponds to CTxMemPoolEntry.nFee
*/
CAmount CalculateExchangeValue(const CAmount& amount, const CAsset& asset);

/**
* Populate the exchange rate map using a config file.
*
* @param[in] file_path File path to INI config file where keys are asset labels and values are exchange rates.
* @param[in] error String reference for storing error message, if there is any.
* @return true on success
*/
bool LoadExchangeRatesFromJSONFile(fs::path file_path, std::string& error);
};

#endif // BITCOIN_EXCHANGERATES_H
20 changes: 19 additions & 1 deletion src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <compat/sanity.h>
#include <consensus/amount.h>
#include <deploymentstatus.h>
#include <exchangerates.h>
#include <fs.h>
#include <hash.h>
#include <httprpc.h>
Expand Down Expand Up @@ -640,6 +641,9 @@ void SetupServerArgs(ArgsManager& argsman)
argsman.AddArg("-initialreissuancetokens=<n>", "The amount of reissuance tokens created in the genesis block. (default: 0)", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
argsman.AddArg("-ct_bits", strprintf("The default number of hiding bits in a rangeproof. Will be exceeded to cover amounts exceeding the maximum hiding value. (default: %d)", 52), ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
argsman.AddArg("-ct_exponent", strprintf("The hiding exponent. (default: %s)", 0), ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
argsman.AddArg("-con_any_asset_fees", "Enable transation sees to be paid with any asset (default: false)", ArgsManager::ALLOW_ANY, OptionsCategory::ELEMENTS);
argsman.AddArg("-exchangeratesjsonfile=<file>", strprintf("Specify path to read-only configuration file with asset valuations. Only used when con_any_asset_fees is enabled. Relative paths will be prefixed by datadir location. (default: %s)", "exchangerates.json"), ArgsManager::ALLOW_ANY, OptionsCategory::ELEMENTS);


#if defined(USE_SYSCALL_SANDBOX)
argsman.AddArg("-sandbox=<mode>", "Use the experimental syscall sandbox in the specified mode (-sandbox=log-and-abort or -sandbox=abort). Allow only expected syscalls to be used by bitcoind. Note that this is an experimental new feature that may cause bitcoind to exit or crash unexpectedly: use with caution. In the \"log-and-abort\" mode the invocation of an unexpected syscall results in a debug handler being invoked which will log the incident and terminate the program (without executing the unexpected syscall). In the \"abort\" mode the invocation of an unexpected syscall results in the entire process being killed immediately by the kernel without executing the unexpected syscall.", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
Expand Down Expand Up @@ -1326,8 +1330,22 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
#endif

// ELEMENTS:
g_con_any_asset_fees = gArgs.GetBoolArg("-con_any_asset_fees", false);
if (g_con_any_asset_fees) {
// If fees can be paid in any asset, node operators need to be able to specify asset exchange
// rates using either the static config file and/or the exchange rates RPCs.
RegisterExchangeRatesRPCCommands(tableRPC);
std::string file_path_string = gArgs.GetArg("-exchangeratesjsonfile", "");
if (!file_path_string.empty()) {
fs::path file_path = AbsPathForConfigVal(fs::PathFromString(file_path_string));
std::string error;
if (!ExchangeRateMap::GetInstance().LoadExchangeRatesFromJSONFile(file_path, error)) {
return InitError(strprintf(_("Unable to load exchange rates from JSON file %s: %s"), file_path_string, error));
};
}
}
policyAsset = CAsset(uint256S(gArgs.GetArg("-feeasset", chainparams.GetConsensus().pegged_asset.GetHex())));

/* Start the RPC server already. It will be started in "warmup" mode
* and not really process calls already (but it will signify connections
* that the server is there and will be ready later). Warmup mode will
Expand Down
2 changes: 1 addition & 1 deletion src/node/interfaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ class ChainImpl : public Chain
if (!m_node.mempool) return true;
LockPoints lp;
std::set<std::pair<uint256, COutPoint>> setPeginsSpent;
CTxMemPoolEntry entry(tx, 0, 0, 0, false, 0, lp, setPeginsSpent);
CTxMemPoolEntry entry(tx, 0, ::policyAsset, 0, 0, 0, false, 0, lp, setPeginsSpent);
CTxMemPool::setEntries ancestors;
auto limit_ancestor_count = gArgs.GetIntArg("-limitancestorcount", DEFAULT_ANCESTOR_LIMIT);
auto limit_ancestor_size = gArgs.GetIntArg("-limitancestorsize", DEFAULT_ANCESTOR_SIZE_LIMIT) * 1000;
Expand Down
49 changes: 32 additions & 17 deletions src/node/miner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ void BlockAssembler::resetBlock()

// These counters do not include coinbase tx
nBlockTx = 0;
nFees = 0;
feeMap = CAmountMap();
}

std::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock(const CScript& scriptPubKeyIn, std::chrono::seconds min_tx_age, DynaFedParamEntry* proposed_entry, const std::vector<CScript>* commit_scripts)
Expand Down Expand Up @@ -193,21 +193,38 @@ std::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock(const CScript& sc
CMutableTransaction coinbaseTx;
coinbaseTx.vin.resize(1);
coinbaseTx.vin[0].prevout.SetNull();
coinbaseTx.vout.resize(1);
coinbaseTx.vout[0].scriptPubKey = scriptPubKeyIn;
coinbaseTx.vout[0].nAsset = policyAsset;
coinbaseTx.vout[0].nValue = nFees + GetBlockSubsidy(nHeight, chainparams.GetConsensus());
if (g_con_elementsmode) {
if(chainparams.GetConsensus().subsidy_asset != policyAsset) {
// Only claim the subsidy if it's the same as the policy asset.
coinbaseTx.vout[0].nValue = nFees;
coinbaseTx.vin[0].scriptSig = CScript() << nHeight << OP_0;
if (feeMap.size() == 0) {
feeMap[::policyAsset] = 0;
}
int index = 0;
for (auto& fee : feeMap) {
auto& feeAsset = fee.first;
auto& feeAmount = fee.second;
if (!g_con_any_asset_fees && feeAsset != ::policyAsset) {
continue;
}
CTxOut newTxOut;
newTxOut.scriptPubKey = scriptPubKeyIn;
newTxOut.nAsset = feeAsset;
newTxOut.nValue = feeAmount;
if (feeAsset == chainparams.GetConsensus().subsidy_asset) {
newTxOut.nValue = feeAmount + GetBlockSubsidy(nHeight, chainparams.GetConsensus());
}
// 0-value outputs must be unspendable
if (coinbaseTx.vout[0].nValue.GetAmount() == 0) {
coinbaseTx.vout[0].scriptPubKey = CScript() << OP_RETURN;
if (g_con_elementsmode) {
if (chainparams.GetConsensus().subsidy_asset != policyAsset) {
// Only claim the subsidy if it's the same as the policy asset.
newTxOut.nValue = feeAmount;
}
// 0-value outputs must be unspendable
if (newTxOut.nValue.GetAmount() == 0) {
newTxOut.scriptPubKey = CScript() << OP_RETURN;
}
}
coinbaseTx.vout.push_back(newTxOut);
pblocktemplate->vTxFees[index] = -feeAmount;
index++;
}
coinbaseTx.vin[0].scriptSig = CScript() << nHeight << OP_0;
// Non-consensus commitment output before finishing coinbase transaction
if (commit_scripts && !commit_scripts->empty()) {
for (auto commit_script: *commit_scripts) {
Expand All @@ -216,9 +233,7 @@ std::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock(const CScript& sc
}
pblock->vtx[0] = MakeTransactionRef(std::move(coinbaseTx));
pblocktemplate->vchCoinbaseCommitment = GenerateCoinbaseCommitment(*pblock, pindexPrev, chainparams.GetConsensus());
pblocktemplate->vTxFees[0] = -nFees;

LogPrintf("CreateNewBlock(): block weight: %u txs: %u fees: %ld sigops %d\n", GetBlockWeight(*pblock), nBlockTx, nFees, nBlockSigOpsCost);
LogPrintf("CreateNewBlock(): block weight: %u txs: %u fees: %s sigops %d\n", GetBlockWeight(*pblock), nBlockTx, feeMap, nBlockSigOpsCost);

// Fill in header
pblock->hashPrevBlock = pindexPrev->GetBlockHash();
Expand Down Expand Up @@ -290,7 +305,7 @@ void BlockAssembler::AddToBlock(CTxMemPool::txiter iter)
nBlockWeight += iter->GetTxWeight();
++nBlockTx;
nBlockSigOpsCost += iter->GetSigOpCost();
nFees += iter->GetFee();
feeMap[iter->GetFeeAsset()] += iter->GetFeeAmount();
inBlock.insert(iter);

bool fPrintPriority = gArgs.GetBoolArg("-printpriority", DEFAULT_PRINTPRIORITY);
Expand Down
2 changes: 1 addition & 1 deletion src/node/miner.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class BlockAssembler
uint64_t nBlockWeight;
uint64_t nBlockTx;
uint64_t nBlockSigOpsCost;
CAmount nFees;
CAmountMap feeMap;
CTxMemPool::setEntries inBlock;

// Chain context for the block
Expand Down
1 change: 1 addition & 0 deletions src/primitives/transaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <assert.h>

bool g_con_elementsmode = false;
bool g_con_any_asset_fees = false;

const int32_t CTransaction::CURRENT_VERSION = 2;

Expand Down
1 change: 1 addition & 0 deletions src/primitives/transaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ static const int SERIALIZE_TRANSACTION_NO_WITNESS = 0x40000000;
// ELEMENTS:
// Globals to avoid circular dependencies.
extern bool g_con_elementsmode;
extern bool g_con_any_asset_fees;

/** An outpoint - a combination of a transaction hash and an index n into its vout */
class COutPoint
Expand Down
1 change: 1 addition & 0 deletions src/rpc/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ static const CRPCConvertParam vRPCConvertParams[] =
{ "calculateasset", 3, "blind_reissuance" },
{ "updatepsbtpegin", 1, "input" },
{ "updatepsbtpegin", 2, "value" },
{ "setfeeexchangerates", 0, "rates"},
JBetz marked this conversation as resolved.
Show resolved Hide resolved

};
// clang-format on
Expand Down
Loading