diff --git a/src/Makefile.bench.include b/src/Makefile.bench.include index 544092520f..0d8089a5db 100644 --- a/src/Makefile.bench.include +++ b/src/Makefile.bench.include @@ -56,7 +56,7 @@ if ENABLE_WALLET bench_bench_bitcoin_SOURCES += bench/coin_selection.cpp endif -bench_bench_bitcoin_LDADD += $(BOOST_LIBS) $(BDB_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) +bench_bench_bitcoin_LDADD += $(BOOST_LIBS) $(BDB_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(EVENT_LIBS) bench_bench_bitcoin_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) CLEAN_BITCOIN_BENCH = bench/*.gcda bench/*.gcno $(GENERATED_BENCH_FILES) diff --git a/src/miner.cpp b/src/miner.cpp index 21f9091048..4e24b7eea2 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -125,7 +125,7 @@ std::unique_ptr BlockAssembler::CreateNewBlock(const CScript& sc // Pad block weight to account for OP_RETURN commitments with two compressed pubkeys for (const auto& commitment : commitments) { CTxOut output(0, commitment); - nBlockWeight += ::GetSerializeSize(output, SER_NETWORK, PROTOCOL_VERSION)*WITNESS_SCALE_FACTOR; + nBlockWeight += ::GetSerializeSize(output, PROTOCOL_VERSION)*WITNESS_SCALE_FACTOR; } // END PAK diff --git a/src/primitives/bitcoin/transaction.cpp b/src/primitives/bitcoin/transaction.cpp index e60b8c305a..46a83c1fd5 100644 --- a/src/primitives/bitcoin/transaction.cpp +++ b/src/primitives/bitcoin/transaction.cpp @@ -96,7 +96,7 @@ CAmount CTransaction::GetValueOut() const unsigned int CTransaction::GetTotalSize() const { - return ::GetSerializeSize(*this, SER_NETWORK, PROTOCOL_VERSION); + return ::GetSerializeSize(*this, PROTOCOL_VERSION); } std::string CTransaction::ToString() const diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp index ceb5ef267a..cbcb04a913 100644 --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -492,9 +492,9 @@ UniValue FormatPAKList(CPAKList &paklist) { retOnline.push_back(HexStr(online_keys[i])); } - paklist_value.push_back(Pair("online", retOnline)); - paklist_value.push_back(Pair("offline", retOffline)); - paklist_value.push_back(Pair("reject", is_reject)); + paklist_value.pushKV("online", retOnline); + paklist_value.pushKV("offline", retOffline); + paklist_value.pushKV("reject", is_reject); return paklist_value; } diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index d85ec039d1..baf2f7b720 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -1019,7 +1019,6 @@ UniValue signrawtransaction(const JSONRPCRequest& request) // CRPCCommand table and rpc/client.cpp. throw JSONRPCError(RPC_METHOD_DEPRECATED, "signrawtransaction was removed in v0.18.\n" "Clients should transition to using signrawtransactionwithkey and signrawtransactionwithwallet"); - " \"warning\" : \"text\" (string) Warning that a peg-in input signed may be immature. This could mean lack of connectivity to or misconfiguration of the bitcoind." } UniValue sendrawtransaction(const JSONRPCRequest& request) diff --git a/src/script/standard.cpp b/src/script/standard.cpp index 690ec56d19..baf0e6681b 100644 --- a/src/script/standard.cpp +++ b/src/script/standard.cpp @@ -95,8 +95,7 @@ txnouttype Solver(const CScript& scriptPubKey, std::vector diff --git a/src/test/mempool_tests.cpp b/src/test/mempool_tests.cpp index 9cd6ab29e5..70d3bfd194 100644 --- a/src/test/mempool_tests.cpp +++ b/src/test/mempool_tests.cpp @@ -446,7 +446,7 @@ BOOST_AUTO_TEST_CASE(PeginSpentTest) tx.vout.resize(1); tx.vout[0].nValue = 0; const uint256 tx1Hash(tx.GetHash()); - pool.addUnchecked(tx1Hash, entry.PeginsSpent(setPeginsSpent).FromTx(tx)); + pool.addUnchecked(entry.PeginsSpent(setPeginsSpent).FromTx(tx)); BOOST_CHECK(pool.mapPeginsSpentToTxid.empty()); setPeginsSpent = {pegin1}; @@ -454,7 +454,7 @@ BOOST_AUTO_TEST_CASE(PeginSpentTest) tx.vout.resize(2); tx.vout[1].nValue = 0; const uint256 tx2Hash(tx.GetHash()); - pool.addUnchecked(tx2Hash, entry.PeginsSpent(setPeginsSpent).FromTx(tx)); + pool.addUnchecked(entry.PeginsSpent(setPeginsSpent).FromTx(tx)); BOOST_CHECK_EQUAL(pool.mapPeginsSpentToTxid[pegin1].ToString(), tx2Hash.ToString()); setPeginsSpent = {pegin2}; @@ -462,7 +462,7 @@ BOOST_AUTO_TEST_CASE(PeginSpentTest) tx.vout.resize(3); tx.vout[2].nValue = 0; const uint256 tx3Hash(tx.GetHash()); - pool.addUnchecked(tx3Hash, entry.PeginsSpent(setPeginsSpent).FromTx(tx)); + pool.addUnchecked(entry.PeginsSpent(setPeginsSpent).FromTx(tx)); BOOST_CHECK_EQUAL(pool.mapPeginsSpentToTxid[pegin2].ToString(), tx3Hash.ToString()); setPeginsSpent = {pegin3}; @@ -493,7 +493,7 @@ BOOST_AUTO_TEST_CASE(PeginSpentTest) tx.vout.resize(6); tx.vout[5].nValue = 0; const uint256 tx4Hash(tx.GetHash()); - pool.addUnchecked(tx4Hash, entry.PeginsSpent(setPeginsSpent).FromTx(tx)); + pool.addUnchecked(entry.PeginsSpent(setPeginsSpent).FromTx(tx)); BOOST_CHECK_EQUAL(pool.mapPeginsSpentToTxid[pegin1].ToString(), tx4Hash.ToString()); BOOST_CHECK_EQUAL(pool.mapPeginsSpentToTxid[pegin3].ToString(), tx4Hash.ToString()); diff --git a/src/txmempool.cpp b/src/txmempool.cpp index c01c2433c0..3df8ad7257 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -21,7 +21,7 @@ CTxMemPoolEntry::CTxMemPoolEntry(const CTransactionRef& _tx, const CAmount& _nFee, int64_t _nTime, unsigned int _entryHeight, - bool _spendsCoinbase, int64_t _sigOpsCost, LockPoints lp, std::set>& _setPeginsSpent): + bool _spendsCoinbase, int64_t _sigOpsCost, LockPoints lp, std::set>& _setPeginsSpent) : tx(_tx), nFee(_nFee), nTxWeight(GetTransactionWeight(*tx)), nUsageSize(RecursiveDynamicUsage(tx)), nTime(_nTime), entryHeight(_entryHeight), spendsCoinbase(_spendsCoinbase), sigOpCost(_sigOpsCost), lockPoints(lp), setPeginsSpent(_setPeginsSpent) @@ -406,7 +406,7 @@ void CTxMemPool::addUnchecked(const CTxMemPoolEntry &entry, setEntries &setAnces typedef std::pair PeginPair; for(const PeginPair& it : entry.setPeginsSpent) { - std::pair, uint256>::iterator, bool> ret = mapPeginsSpentToTxid.insert(std::make_pair(it, hash)); + std::pair, uint256>::iterator, bool> ret = mapPeginsSpentToTxid.insert(std::make_pair(it, tx.GetHash())); assert(ret.second); } } diff --git a/src/wallet/rpcdump.cpp b/src/wallet/rpcdump.cpp index 9e28bbcc59..f19a1bb569 100644 --- a/src/wallet/rpcdump.cpp +++ b/src/wallet/rpcdump.cpp @@ -1284,7 +1284,7 @@ UniValue getwalletpakinfo(const JSONRPCRequest& request) UniValue ret(UniValue::VOBJ); std::stringstream ss; ss << pwallet->offline_counter; - ret.push_back(Pair("bip32_counter", ss.str())); + ret.pushKV("bip32_counter", ss.str()); const std::string desc_str = pwallet->offline_desc; @@ -1306,6 +1306,6 @@ UniValue getwalletpakinfo(const JSONRPCRequest& request) address_list.push_back(EncodeParentDestination(destination)); } - ret.push_back(Pair("address_lookahead", address_list)); + ret.pushKV("address_lookahead", address_list); return ret; } diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 3ebf9b4093..9554bc3d1a 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -4387,10 +4387,10 @@ UniValue initpegoutwallet(const JSONRPCRequest& request) address_list.push_back(EncodeParentDestination(destination)); } UniValue pak(UniValue::VOBJ); - pak.push_back(Pair("pakentry", "pak=" + HexStr(negatedpubkeybytes) + ":" + HexStr(online_pubkey))); - pak.push_back(Pair("liquid_pak", HexStr(online_pubkey))); - pak.push_back(Pair("liquid_pak_address", EncodeDestination(online_key_id))); - pak.push_back(Pair("address_lookahead", address_list)); + pak.pushKV("pakentry", "pak=" + HexStr(negatedpubkeybytes) + ":" + HexStr(online_pubkey)); + pak.pushKV("liquid_pak", HexStr(online_pubkey)); + pak.pushKV("liquid_pak_address", EncodeDestination(online_key_id)); + pak.pushKV("address_lookahead", address_list); return pak; } @@ -4450,7 +4450,7 @@ UniValue sendtomainchain_base(const JSONRPCRequest& request) mapValue_t mapValue; CCoinControl no_coin_control; // This is a deprecated API - CTransactionRef tx = SendMoney(pwallet, address, nAmount, subtract_fee, no_coin_control, std::move(mapValue), {}); + CTransactionRef tx = SendMoney(pwallet, address, nAmount, subtract_fee, no_coin_control, std::move(mapValue)); //TODO(rebase) CT/CA // v this line was in elements-0.14 instead of the line above here @@ -4695,7 +4695,7 @@ UniValue sendtomainchain_pak(const JSONRPCRequest& request) mapValue_t mapValue; CCoinControl no_coin_control; // This is a deprecated API - CTransactionRef tx = SendMoney(pwallet, address, nAmount, subtract_fee, no_coin_control, std::move(mapValue), {}); + CTransactionRef tx = SendMoney(pwallet, address, nAmount, subtract_fee, no_coin_control, std::move(mapValue)); pwallet->SetOfflineCounter(counter+1); @@ -4703,10 +4703,10 @@ UniValue sendtomainchain_pak(const JSONRPCRequest& request) ss << counter; UniValue obj(UniValue::VOBJ); - obj.push_back(Pair("txid", tx->GetHash().GetHex())); - obj.push_back(Pair("bitcoin_address", EncodeParentDestination(bitcoin_address))); - obj.push_back(Pair("bip32_counter", ss.str())); - obj.push_back(Pair("bitcoin_descriptor", pwallet->offline_desc)); + obj.pushKV("txid", tx->GetHash().GetHex()); + obj.pushKV("bitcoin_address", EncodeParentDestination(bitcoin_address)); + obj.pushKV("bip32_counter", ss.str()); + obj.pushKV("bitcoin_descriptor", pwallet->offline_desc); return obj; } @@ -5009,7 +5009,7 @@ UniValue claimpegin(const JSONRPCRequest& request) CValidationState state; mapValue_t mapValue; CReserveKey reservekey(pwallet); - if (!pwallet->CommitTransaction(MakeTransactionRef(mtx), mapValue, {} /* orderForm */, "", reservekey, g_connman.get(), state)) { + if (!pwallet->CommitTransaction(MakeTransactionRef(mtx), mapValue, {} /* orderForm */, reservekey, g_connman.get(), state)) { std::string strError = strprintf("Error: The transaction was rejected! Reason given: %s", FormatStateMessage(state)); throw JSONRPCError(RPC_WALLET_ERROR, strError); }