diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/init.cpp | 11 | ||||
-rw-r--r-- | src/net_processing.cpp | 57 | ||||
-rw-r--r-- | src/net_processing.h | 9 | ||||
-rw-r--r-- | src/qt/bitcoinstrings.cpp | 9 | ||||
-rw-r--r-- | src/qt/locale/bitcoin_en.ts | 616 | ||||
-rw-r--r-- | src/random.cpp | 13 | ||||
-rw-r--r-- | src/rpc/blockchain.cpp | 12 | ||||
-rw-r--r-- | src/rpc/mining.cpp | 2 | ||||
-rw-r--r-- | src/rpc/misc.cpp | 6 | ||||
-rw-r--r-- | src/rpc/net.cpp | 23 | ||||
-rw-r--r-- | src/rpc/server.cpp | 5 | ||||
-rw-r--r-- | src/rpc/util.h | 5 | ||||
-rw-r--r-- | src/sync.h | 4 | ||||
-rw-r--r-- | src/test/denialofservice_tests.cpp | 10 | ||||
-rw-r--r-- | src/test/fuzz/process_message.cpp | 4 | ||||
-rw-r--r-- | src/test/util/setup_common.cpp | 2 | ||||
-rw-r--r-- | src/validation.cpp | 2 | ||||
-rw-r--r-- | src/wallet/rpcdump.cpp | 14 | ||||
-rw-r--r-- | src/wallet/rpcwallet.cpp | 30 |
19 files changed, 399 insertions, 435 deletions
diff --git a/src/init.cpp b/src/init.cpp index a637aac4d2..97640b0658 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1329,8 +1329,12 @@ bool AppInitMain(NodeContext& node) node.banman = MakeUnique<BanMan>(GetDataDir() / "banlist.dat", &uiInterface, gArgs.GetArg("-bantime", DEFAULT_MISBEHAVING_BANTIME)); assert(!node.connman); node.connman = std::unique_ptr<CConnman>(new CConnman(GetRand(std::numeric_limits<uint64_t>::max()), GetRand(std::numeric_limits<uint64_t>::max()))); + // Make mempool generally available in the node context. For example the connection manager, wallet, or RPC threads, + // which are all started after this, may use it from the node context. + assert(!node.mempool); + node.mempool = &::mempool; - node.peer_logic.reset(new PeerLogicValidation(node.connman.get(), node.banman.get(), *node.scheduler)); + node.peer_logic.reset(new PeerLogicValidation(node.connman.get(), node.banman.get(), *node.scheduler, *node.mempool)); RegisterValidationInterface(node.peer_logic.get()); // sanitize comments per BIP-0014, format user agent and check total size @@ -1678,11 +1682,6 @@ bool AppInitMain(NodeContext& node) return false; } - // Now that the chain state is loaded, make mempool generally available in the node context. For example the - // connection manager, wallet, or RPC threads, which are all started after this, may use it from the node context. - assert(!node.mempool); - node.mempool = &::mempool; - fs::path est_path = GetDataDir() / FEE_ESTIMATES_FILENAME; CAutoFile est_filein(fsbridge::fopen(est_path, "rb"), SER_DISK, CLIENT_VERSION); // Allowed to fail as this file IS missing on first startup. diff --git a/src/net_processing.cpp b/src/net_processing.cpp index e4df9fb90e..d9b048fd65 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -465,7 +465,7 @@ static bool MarkBlockAsReceived(const uint256& hash) EXCLUSIVE_LOCKS_REQUIRED(cs // returns false, still setting pit, if the block was already in flight from the same peer // pit will only be valid as long as the same cs_main lock is being held -static bool MarkBlockAsInFlight(NodeId nodeid, const uint256& hash, const CBlockIndex* pindex = nullptr, std::list<QueuedBlock>::iterator** pit = nullptr) EXCLUSIVE_LOCKS_REQUIRED(cs_main) { +static bool MarkBlockAsInFlight(CTxMemPool& mempool, NodeId nodeid, const uint256& hash, const CBlockIndex* pindex = nullptr, std::list<QueuedBlock>::iterator** pit = nullptr) EXCLUSIVE_LOCKS_REQUIRED(cs_main) { CNodeState *state = State(nodeid); assert(state != nullptr); @@ -1102,8 +1102,11 @@ static bool BlockRequestAllowed(const CBlockIndex* pindex, const Consensus::Para (GetBlockProofEquivalentTime(*pindexBestHeader, *pindex, *pindexBestHeader, consensusParams) < STALE_RELAY_AGE_LIMIT); } -PeerLogicValidation::PeerLogicValidation(CConnman* connmanIn, BanMan* banman, CScheduler& scheduler) - : connman(connmanIn), m_banman(banman), m_stale_tip_check_time(0) +PeerLogicValidation::PeerLogicValidation(CConnman* connmanIn, BanMan* banman, CScheduler& scheduler, CTxMemPool& pool) + : connman(connmanIn), + m_banman(banman), + m_mempool(pool), + m_stale_tip_check_time(0) { // Initialize global variables that cannot be constructed at startup. recentRejects.reset(new CRollingBloomFilter(120000, 0.000001)); @@ -1314,7 +1317,7 @@ void PeerLogicValidation::BlockChecked(const CBlock& block, const BlockValidatio // -bool static AlreadyHave(const CInv& inv) EXCLUSIVE_LOCKS_REQUIRED(cs_main) +bool static AlreadyHave(const CInv& inv, const CTxMemPool& mempool) EXCLUSIVE_LOCKS_REQUIRED(cs_main) { switch (inv.type) { @@ -1553,7 +1556,7 @@ void static ProcessGetBlockData(CNode* pfrom, const CChainParams& chainparams, c } } -void static ProcessGetData(CNode* pfrom, const CChainParams& chainparams, CConnman* connman, const std::atomic<bool>& interruptMsgProc) LOCKS_EXCLUDED(cs_main) +void static ProcessGetData(CNode* pfrom, const CChainParams& chainparams, CConnman* connman, const CTxMemPool& mempool, const std::atomic<bool>& interruptMsgProc) LOCKS_EXCLUDED(cs_main) { AssertLockNotHeld(cs_main); @@ -1666,7 +1669,7 @@ inline void static SendBlockTransactions(const CBlock& block, const BlockTransac connman->PushMessage(pfrom, msgMaker.Make(nSendFlags, NetMsgType::BLOCKTXN, resp)); } -bool static ProcessHeadersMessage(CNode *pfrom, CConnman *connman, const std::vector<CBlockHeader>& headers, const CChainParams& chainparams, bool via_compact_block) +bool static ProcessHeadersMessage(CNode* pfrom, CConnman* connman, CTxMemPool& mempool, const std::vector<CBlockHeader>& headers, const CChainParams& chainparams, bool via_compact_block) { const CNetMsgMaker msgMaker(pfrom->GetSendVersion()); size_t nCount = headers.size(); @@ -1794,7 +1797,7 @@ bool static ProcessHeadersMessage(CNode *pfrom, CConnman *connman, const std::ve } uint32_t nFetchFlags = GetFetchFlags(pfrom); vGetData.push_back(CInv(MSG_BLOCK | nFetchFlags, pindex->GetBlockHash())); - MarkBlockAsInFlight(pfrom->GetId(), pindex->GetBlockHash(), pindex); + MarkBlockAsInFlight(mempool, pfrom->GetId(), pindex->GetBlockHash(), pindex); LogPrint(BCLog::NET, "Requesting block %s from peer=%d\n", pindex->GetBlockHash().ToString(), pfrom->GetId()); } @@ -1848,7 +1851,7 @@ bool static ProcessHeadersMessage(CNode *pfrom, CConnman *connman, const std::ve return true; } -void static ProcessOrphanTx(CConnman* connman, std::set<uint256>& orphan_work_set, std::list<CTransactionRef>& removed_txn) EXCLUSIVE_LOCKS_REQUIRED(cs_main, g_cs_orphans) +void static ProcessOrphanTx(CConnman* connman, CTxMemPool& mempool, std::set<uint256>& orphan_work_set, std::list<CTransactionRef>& removed_txn) EXCLUSIVE_LOCKS_REQUIRED(cs_main, g_cs_orphans) { AssertLockHeld(cs_main); AssertLockHeld(g_cs_orphans); @@ -1908,7 +1911,7 @@ void static ProcessOrphanTx(CConnman* connman, std::set<uint256>& orphan_work_se } } -bool ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStream& vRecv, int64_t nTimeReceived, const CChainParams& chainparams, CConnman* connman, BanMan* banman, const std::atomic<bool>& interruptMsgProc) +bool ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStream& vRecv, int64_t nTimeReceived, const CChainParams& chainparams, CTxMemPool& mempool, CConnman* connman, BanMan* banman, const std::atomic<bool>& interruptMsgProc) { LogPrint(BCLog::NET, "received: %s (%u bytes) peer=%d\n", SanitizeString(strCommand), vRecv.size(), pfrom->GetId()); if (gArgs.IsArgSet("-dropmessagestest") && GetRand(gArgs.GetArg("-dropmessagestest", 0)) == 0) @@ -2260,7 +2263,7 @@ bool ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStream& vR if (interruptMsgProc) return true; - bool fAlreadyHave = AlreadyHave(inv); + bool fAlreadyHave = AlreadyHave(inv, mempool); LogPrint(BCLog::NET, "got inv: %s %s peer=%d\n", inv.ToString(), fAlreadyHave ? "have" : "new", pfrom->GetId()); if (inv.type == MSG_TX) { @@ -2311,7 +2314,7 @@ bool ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStream& vR } pfrom->vRecvGetData.insert(pfrom->vRecvGetData.end(), vInv.begin(), vInv.end()); - ProcessGetData(pfrom, chainparams, connman, interruptMsgProc); + ProcessGetData(pfrom, chainparams, connman, mempool, interruptMsgProc); return true; } @@ -2528,7 +2531,7 @@ bool ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStream& vR std::list<CTransactionRef> lRemovedTxn; - if (!AlreadyHave(inv) && + if (!AlreadyHave(inv, mempool) && AcceptToMemoryPool(mempool, state, ptx, &lRemovedTxn, false /* bypass_limits */, 0 /* nAbsurdFee */)) { mempool.check(&::ChainstateActive().CoinsTip()); RelayTransaction(tx.GetHash(), *connman); @@ -2549,7 +2552,7 @@ bool ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStream& vR mempool.size(), mempool.DynamicMemoryUsage() / 1000); // Recursively process any orphan transactions that depended on this one - ProcessOrphanTx(connman, pfrom->orphan_work_set, lRemovedTxn); + ProcessOrphanTx(connman, mempool, pfrom->orphan_work_set, lRemovedTxn); } else if (state.GetResult() == TxValidationResult::TX_MISSING_INPUTS) { @@ -2567,7 +2570,7 @@ bool ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStream& vR for (const CTxIn& txin : tx.vin) { CInv _inv(MSG_TX | nFetchFlags, txin.prevout.hash); pfrom->AddInventoryKnown(_inv); - if (!AlreadyHave(_inv)) RequestTx(State(pfrom->GetId()), _inv.hash, current_time); + if (!AlreadyHave(_inv, mempool)) RequestTx(State(pfrom->GetId()), _inv.hash, current_time); } AddOrphanTx(ptx, pfrom->GetId()); @@ -2742,7 +2745,7 @@ bool ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStream& vR if ((!fAlreadyInFlight && nodestate->nBlocksInFlight < MAX_BLOCKS_IN_TRANSIT_PER_PEER) || (fAlreadyInFlight && blockInFlightIt->second.first == pfrom->GetId())) { std::list<QueuedBlock>::iterator* queuedBlockIt = nullptr; - if (!MarkBlockAsInFlight(pfrom->GetId(), pindex->GetBlockHash(), pindex, &queuedBlockIt)) { + if (!MarkBlockAsInFlight(mempool, pfrom->GetId(), pindex->GetBlockHash(), pindex, &queuedBlockIt)) { if (!(*queuedBlockIt)->partialBlock) (*queuedBlockIt)->partialBlock.reset(new PartiallyDownloadedBlock(&mempool)); else { @@ -2815,7 +2818,7 @@ bool ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStream& vR } // cs_main if (fProcessBLOCKTXN) - return ProcessMessage(pfrom, NetMsgType::BLOCKTXN, blockTxnMsg, nTimeReceived, chainparams, connman, banman, interruptMsgProc); + return ProcessMessage(pfrom, NetMsgType::BLOCKTXN, blockTxnMsg, nTimeReceived, chainparams, mempool, connman, banman, interruptMsgProc); if (fRevertToHeaderProcessing) { // Headers received from HB compact block peers are permitted to be @@ -2823,7 +2826,7 @@ bool ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStream& vR // the peer if the header turns out to be for an invalid block. // Note that if a peer tries to build on an invalid chain, that // will be detected and the peer will be banned. - return ProcessHeadersMessage(pfrom, connman, {cmpctblock.header}, chainparams, /*via_compact_block=*/true); + return ProcessHeadersMessage(pfrom, connman, mempool, {cmpctblock.header}, chainparams, /*via_compact_block=*/true); } if (fBlockReconstructed) { @@ -2967,7 +2970,7 @@ bool ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStream& vR ReadCompactSize(vRecv); // ignore tx count; assume it is 0. } - return ProcessHeadersMessage(pfrom, connman, headers, chainparams, /*via_compact_block=*/false); + return ProcessHeadersMessage(pfrom, connman, mempool, headers, chainparams, /*via_compact_block=*/false); } if (strCommand == NetMsgType::BLOCK) @@ -3285,12 +3288,12 @@ bool PeerLogicValidation::ProcessMessages(CNode* pfrom, std::atomic<bool>& inter bool fMoreWork = false; if (!pfrom->vRecvGetData.empty()) - ProcessGetData(pfrom, chainparams, connman, interruptMsgProc); + ProcessGetData(pfrom, chainparams, connman, m_mempool, interruptMsgProc); if (!pfrom->orphan_work_set.empty()) { std::list<CTransactionRef> removed_txn; LOCK2(cs_main, g_cs_orphans); - ProcessOrphanTx(connman, pfrom->orphan_work_set, removed_txn); + ProcessOrphanTx(connman, m_mempool, pfrom->orphan_work_set, removed_txn); for (const CTransactionRef& removedTx : removed_txn) { AddToCompactExtraTransactions(removedTx); } @@ -3353,7 +3356,7 @@ bool PeerLogicValidation::ProcessMessages(CNode* pfrom, std::atomic<bool>& inter bool fRet = false; try { - fRet = ProcessMessage(pfrom, strCommand, vRecv, msg.m_time, chainparams, connman, m_banman, interruptMsgProc); + fRet = ProcessMessage(pfrom, strCommand, vRecv, msg.m_time, chainparams, m_mempool, connman, m_banman, interruptMsgProc); if (interruptMsgProc) return false; if (!pfrom->vRecvGetData.empty()) @@ -3819,7 +3822,7 @@ bool PeerLogicValidation::SendMessages(CNode* pto) // Respond to BIP35 mempool requests if (fSendTrickle && pto->m_tx_relay->fSendMempool) { - auto vtxinfo = mempool.infoAll(); + auto vtxinfo = m_mempool.infoAll(); pto->m_tx_relay->fSendMempool = false; CFeeRate filterrate; { @@ -3865,7 +3868,7 @@ bool PeerLogicValidation::SendMessages(CNode* pto) } // Topologically and fee-rate sort the inventory we send for privacy and priority reasons. // A heap is used so that not all items need sorting if only a few are being sent. - CompareInvMempoolOrder compareInvMempoolOrder(&mempool); + CompareInvMempoolOrder compareInvMempoolOrder(&m_mempool); std::make_heap(vInvTx.begin(), vInvTx.end(), compareInvMempoolOrder); // No reason to drain out at many times the network's capacity, // especially since we have many peers and some will draw much shorter delays. @@ -3884,7 +3887,7 @@ bool PeerLogicValidation::SendMessages(CNode* pto) continue; } // Not in the mempool anymore? don't bother sending it. - auto txinfo = mempool.info(hash); + auto txinfo = m_mempool.info(hash); if (!txinfo.tx) { continue; } @@ -3996,7 +3999,7 @@ bool PeerLogicValidation::SendMessages(CNode* pto) for (const CBlockIndex *pindex : vToDownload) { uint32_t nFetchFlags = GetFetchFlags(pto); vGetData.push_back(CInv(MSG_BLOCK | nFetchFlags, pindex->GetBlockHash())); - MarkBlockAsInFlight(pto->GetId(), pindex->GetBlockHash(), pindex); + MarkBlockAsInFlight(m_mempool, pto->GetId(), pindex->GetBlockHash(), pindex); LogPrint(BCLog::NET, "Requesting block %s (%d) peer=%d\n", pindex->GetBlockHash().ToString(), pindex->nHeight, pto->GetId()); } @@ -4039,7 +4042,7 @@ bool PeerLogicValidation::SendMessages(CNode* pto) // processing at a later time, see below) tx_process_time.erase(tx_process_time.begin()); CInv inv(MSG_TX | GetFetchFlags(pto), txid); - if (!AlreadyHave(inv)) { + if (!AlreadyHave(inv, m_mempool)) { // If this transaction was last requested more than 1 minute ago, // then request. const auto last_request_time = GetTxRequestTime(inv.hash); @@ -4077,7 +4080,7 @@ bool PeerLogicValidation::SendMessages(CNode* pto) // We don't want white listed peers to filter txs to us if we have -whitelistforcerelay if (pto->m_tx_relay != nullptr && pto->nVersion >= FEEFILTER_VERSION && gArgs.GetBoolArg("-feefilter", DEFAULT_FEEFILTER) && !pto->HasPermission(PF_FORCERELAY)) { - CAmount currentFilter = mempool.GetMinFee(gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000).GetFeePerK(); + CAmount currentFilter = m_mempool.GetMinFee(gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000).GetFeePerK(); int64_t timeNow = GetTimeMicros(); if (timeNow > pto->m_tx_relay->nextSendTimeFeeFilter) { static CFeeRate default_feerate(DEFAULT_MIN_RELAY_TX_FEE); diff --git a/src/net_processing.h b/src/net_processing.h index 6f26abc209..b73037722c 100644 --- a/src/net_processing.h +++ b/src/net_processing.h @@ -6,10 +6,12 @@ #ifndef BITCOIN_NET_PROCESSING_H #define BITCOIN_NET_PROCESSING_H -#include <net.h> -#include <validationinterface.h> #include <consensus/params.h> +#include <net.h> #include <sync.h> +#include <validationinterface.h> + +class CTxMemPool; extern RecursiveMutex cs_main; @@ -23,11 +25,12 @@ class PeerLogicValidation final : public CValidationInterface, public NetEventsI private: CConnman* const connman; BanMan* const m_banman; + CTxMemPool& m_mempool; bool CheckIfBanned(CNode* pnode) EXCLUSIVE_LOCKS_REQUIRED(cs_main); public: - PeerLogicValidation(CConnman* connman, BanMan* banman, CScheduler& scheduler); + PeerLogicValidation(CConnman* connman, BanMan* banman, CScheduler& scheduler, CTxMemPool& pool); /** * Overridden from CValidationInterface. diff --git a/src/qt/bitcoinstrings.cpp b/src/qt/bitcoinstrings.cpp index 3d40ee7823..64900a4343 100644 --- a/src/qt/bitcoinstrings.cpp +++ b/src/qt/bitcoinstrings.cpp @@ -51,9 +51,6 @@ QT_TRANSLATE_NOOP("bitcoin-core", "" "Prune: last wallet synchronisation goes beyond pruned data. You need to -" "reindex (download the whole blockchain again in case of pruned node)"), QT_TRANSLATE_NOOP("bitcoin-core", "" -"Rescans are not possible in pruned mode. You will need to use -reindex which " -"will download the whole blockchain again."), -QT_TRANSLATE_NOOP("bitcoin-core", "" "The block database contains a block which appears to be from the future. " "This may be due to your computer's date and time being set incorrectly. Only " "rebuild the block database if you are sure that your computer's date and " @@ -69,10 +66,6 @@ QT_TRANSLATE_NOOP("bitcoin-core", "" QT_TRANSLATE_NOOP("bitcoin-core", "" "This is the transaction fee you may pay when fee estimates are not available."), QT_TRANSLATE_NOOP("bitcoin-core", "" -"This product includes software developed by the OpenSSL Project for use in " -"the OpenSSL Toolkit %s and cryptographic software written by Eric Young and " -"UPnP software written by Thomas Bernard."), -QT_TRANSLATE_NOOP("bitcoin-core", "" "Total length of network version string (%i) exceeds maximum length (%i). " "Reduce the number or size of uacomments."), QT_TRANSLATE_NOOP("bitcoin-core", "" @@ -107,6 +100,8 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Change index out of range"), QT_TRANSLATE_NOOP("bitcoin-core", "Config setting for %s only applied on %s network when in [%s] section."), QT_TRANSLATE_NOOP("bitcoin-core", "Copyright (C) %i-%i"), QT_TRANSLATE_NOOP("bitcoin-core", "Corrupted block database detected"), +QT_TRANSLATE_NOOP("bitcoin-core", "Could not find asmap file %s"), +QT_TRANSLATE_NOOP("bitcoin-core", "Could not parse asmap file %s"), QT_TRANSLATE_NOOP("bitcoin-core", "Do you want to rebuild the block database now?"), QT_TRANSLATE_NOOP("bitcoin-core", "Done loading"), QT_TRANSLATE_NOOP("bitcoin-core", "Error initializing block database"), diff --git a/src/qt/locale/bitcoin_en.ts b/src/qt/locale/bitcoin_en.ts index d34fd9eb45..2302226360 100644 --- a/src/qt/locale/bitcoin_en.ts +++ b/src/qt/locale/bitcoin_en.ts @@ -312,7 +312,7 @@ <context> <name>BanTableModel</name> <message> - <location filename="../bantablemodel.cpp" line="+88"/> + <location filename="../bantablemodel.cpp" line="+86"/> <source>IP/Netmask</source> <translation type="unfinished"></translation> </message> @@ -330,12 +330,12 @@ <translation>Sign &message...</translation> </message> <message> - <location line="+623"/> + <location line="+630"/> <source>Synchronizing with network...</source> <translation>Synchronizing with network...</translation> </message> <message> - <location line="-701"/> + <location line="-708"/> <source>&Overview</source> <translation>&Overview</translation> </message> @@ -420,17 +420,17 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+1"/> + <location line="+2"/> <source>Create a new wallet</source> <translation type="unfinished"></translation> </message> <message> - <location line="+190"/> + <location line="+191"/> <source>Wallet:</source> <translation type="unfinished"></translation> </message> <message> - <location line="+334"/> + <location line="+339"/> <source>Click to disable network activity.</source> <translation type="unfinished"></translation> </message> @@ -460,7 +460,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="-1021"/> + <location line="-1028"/> <source>Send coins to a Bitcoin address</source> <translation>Send coins to a Bitcoin address</translation> </message> @@ -475,17 +475,7 @@ <translation>Change the passphrase used for wallet encryption</translation> </message> <message> - <location line="+6"/> - <source>&Debug window</source> - <translation>&Debug window</translation> - </message> - <message> - <location line="+1"/> - <source>Open debugging and diagnostic console</source> - <translation>Open debugging and diagnostic console</translation> - </message> - <message> - <location line="-4"/> + <location line="+3"/> <source>&Verify message...</source> <translation>&Verify message...</translation> </message> @@ -525,7 +515,7 @@ <translation>Verify messages to ensure they were signed with specified Bitcoin addresses</translation> </message> <message> - <location line="+110"/> + <location line="+111"/> <source>&File</source> <translation>&File</translation> </message> @@ -535,7 +525,7 @@ <translation>&Settings</translation> </message> <message> - <location line="+58"/> + <location line="+59"/> <source>&Help</source> <translation>&Help</translation> </message> @@ -545,7 +535,7 @@ <translation>Tabs toolbar</translation> </message> <message> - <location line="-256"/> + <location line="-258"/> <source>Request payments (generates QR codes and bitcoin: URIs)</source> <translation type="unfinished"></translation> </message> @@ -560,17 +550,12 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+3"/> - <source>Open a bitcoin: URI or payment request</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+13"/> + <location line="+17"/> <source>&Command-line options</source> <translation type="unfinished"></translation> </message> <message numerus="yes"> - <location line="+522"/> + <location line="+528"/> <source>%n active connection(s) to Bitcoin network</source> <translation> <numerusform>%n active connection to Bitcoin network</numerusform> @@ -631,7 +616,17 @@ <translation>Up to date</translation> </message> <message> - <location line="-642"/> + <location line="-655"/> + <source>Node window</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Open node debugging and diagnostic console</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+5"/> <source>&Sending addresses</source> <translation type="unfinished"></translation> </message> @@ -641,7 +636,12 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+6"/> + <location line="+4"/> + <source>Open a bitcoin: URI</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+2"/> <source>Open Wallet</source> <translation type="unfinished"></translation> </message> @@ -661,7 +661,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+7"/> + <location line="+8"/> <source>Show the %1 help message to get a list with possible Bitcoin command-line options</source> <translation type="unfinished"></translation> </message> @@ -696,7 +696,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+232"/> + <location line="+238"/> <source>%1 client</source> <translation type="unfinished"></translation> </message> @@ -792,7 +792,7 @@ <translation>Wallet is <b>encrypted</b> and currently <b>locked</b></translation> </message> <message> - <location filename="../bitcoin.cpp" line="+386"/> + <location filename="../bitcoin.cpp" line="+384"/> <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source> <translation type="unfinished"></translation> </message> @@ -885,7 +885,7 @@ <translation type="unfinished">Confirmed</translation> </message> <message> - <location filename="../coincontroldialog.cpp" line="+54"/> + <location filename="../coincontroldialog.cpp" line="+53"/> <source>Copy address</source> <translation type="unfinished"></translation> </message> @@ -990,7 +990,7 @@ <context> <name>CreateWalletActivity</name> <message> - <location filename="../walletcontroller.cpp" line="+201"/> + <location filename="../walletcontroller.cpp" line="+209"/> <source>Creating Wallet <b>%1</b>...</source> <translation type="unfinished"></translation> </message> @@ -1124,7 +1124,7 @@ <context> <name>FreespaceChecker</name> <message> - <location filename="../intro.cpp" line="+73"/> + <location filename="../intro.cpp" line="+71"/> <source>A new data directory will be created.</source> <translation>A new data directory will be created.</translation> </message> @@ -1152,18 +1152,12 @@ <context> <name>HelpMessageDialog</name> <message> - <location filename="../utilitydialog.cpp" line="+39"/> + <location filename="../utilitydialog.cpp" line="+35"/> <source>version</source> <translation type="unfinished">version</translation> </message> <message> - <location line="+5"/> - <location line="+2"/> - <source>(%1-bit)</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+5"/> + <location line="+4"/> <source>About %1</source> <translation type="unfinished"></translation> </message> @@ -1221,27 +1215,27 @@ <translation>Use a custom data directory:</translation> </message> <message> - <location filename="../intro.cpp" line="+22"/> + <location filename="../intro.cpp" line="+32"/> <source>Bitcoin</source> <translation type="unfinished">Bitcoin</translation> </message> <message> - <location line="+9"/> + <location line="+8"/> <source>Discard blocks after verification, except most recent %1 GB (prune)</source> <translation type="unfinished"></translation> </message> <message> - <location line="+2"/> + <location line="+212"/> <source>At least %1 GB of data will be stored in this directory, and it will grow over time.</source> <translation type="unfinished"></translation> </message> <message> - <location line="+5"/> + <location line="+3"/> <source>Approximately %1 GB of data will be stored in this directory.</source> <translation type="unfinished"></translation> </message> <message> - <location line="+8"/> + <location line="+4"/> <source>%1 will download and store a copy of the Bitcoin block chain.</source> <translation type="unfinished"></translation> </message> @@ -1251,7 +1245,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+78"/> + <location line="-137"/> <source>Error: Specified data directory "%1" cannot be created.</source> <translation type="unfinished"></translation> </message> @@ -1261,7 +1255,7 @@ <translation>Error</translation> </message> <message numerus="yes"> - <location line="+9"/> + <location line="+21"/> <source>%n GB of free space available</source> <translation> <numerusform>%n GB of free space available</numerusform> @@ -1269,7 +1263,7 @@ </translation> </message> <message numerus="yes"> - <location line="+3"/> + <location line="+2"/> <source>(of %n GB needed)</source> <translation> <numerusform>(of %n GB needed)</numerusform> @@ -1277,7 +1271,7 @@ </translation> </message> <message numerus="yes"> - <location line="+4"/> + <location line="+3"/> <source>(%n GB needed for full chain)</source> <translation type="unfinished"> <numerusform></numerusform> @@ -1310,7 +1304,7 @@ <message> <location line="+7"/> <location line="+26"/> - <location filename="../modaloverlay.cpp" line="+141"/> + <location filename="../modaloverlay.cpp" line="+145"/> <source>Unknown...</source> <translation type="unfinished"></translation> </message> @@ -1346,36 +1340,31 @@ <translation type="unfinished"></translation> </message> <message> - <location filename="../modaloverlay.cpp" line="+6"/> - <source>Unknown. Syncing Headers (%1, %2%)...</source> - <translation type="unfinished"></translation> - </message> -</context> -<context> - <name>OpenURIDialog</name> - <message> - <location filename="../forms/openuridialog.ui" line="+14"/> - <source>Open URI</source> + <location line="+3"/> + <source>Esc</source> <translation type="unfinished"></translation> </message> <message> - <location line="+6"/> - <source>Open payment request from URI or file</source> + <location filename="../modaloverlay.cpp" line="-111"/> + <source>%1 is currently syncing. It will download headers and blocks from peers and validate them until reaching the tip of the block chain.</source> <translation type="unfinished"></translation> </message> <message> - <location line="+9"/> - <source>URI:</source> + <location line="+117"/> + <source>Unknown. Syncing Headers (%1, %2%)...</source> <translation type="unfinished"></translation> </message> +</context> +<context> + <name>OpenURIDialog</name> <message> - <location line="+10"/> - <source>Select payment request file</source> + <location filename="../forms/openuridialog.ui" line="+14"/> + <source>Open bitcoin URI</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../openuridialog.cpp" line="+45"/> - <source>Select payment request file to open</source> + <location line="+8"/> + <source>URI:</source> <translation type="unfinished"></translation> </message> </context> @@ -1474,7 +1463,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+76"/> + <location line="+79"/> <source>Open the %1 configuration file from the working directory.</source> <translation type="unfinished"></translation> </message> @@ -1494,7 +1483,7 @@ <translation>&Reset Options</translation> </message> <message> - <location line="-529"/> + <location line="-532"/> <source>&Network</source> <translation>&Network</translation> </message> @@ -1682,7 +1671,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+41"/> + <location line="+44"/> <source>Options set in this dialog are overridden by the command line or in the configuration file:</source> <translation type="unfinished"></translation> </message> @@ -1702,7 +1691,7 @@ <translation>default</translation> </message> <message> - <location line="+67"/> + <location line="+65"/> <source>none</source> <translation type="unfinished"></translation> </message> @@ -1850,65 +1839,48 @@ <context> <name>PaymentServer</name> <message> - <location filename="../paymentserver.cpp" line="+226"/> - <location line="+350"/> - <location line="+42"/> - <location line="+108"/> - <location line="+14"/> - <location line="+18"/> + <location filename="../paymentserver.cpp" line="+174"/> <source>Payment request error</source> <translation type="unfinished"></translation> </message> <message> - <location line="-531"/> + <location line="+1"/> <source>Cannot start bitcoin: click-to-pay handler</source> <translation type="unfinished"></translation> </message> <message> - <location line="+62"/> - <location line="+9"/> - <location line="+16"/> - <location line="+16"/> - <location line="+7"/> + <location line="+50"/> + <location line="+13"/> + <location line="+6"/> <location line="+7"/> <source>URI handling</source> <translation type="unfinished"></translation> </message> <message> - <location line="-55"/> + <location line="-26"/> <source>'bitcoin://' is not a valid URI. Use 'bitcoin:' instead.</source> <translation type="unfinished"></translation> </message> <message> - <location line="+10"/> - <source>You are using a BIP70 URL which will be unsupported in the future.</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+16"/> - <source>Payment request fetch URL is invalid: %1</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+16"/> - <location line="+38"/> - <source>Cannot process payment request because BIP70 support was not compiled in.</source> + <location line="+14"/> + <location line="+23"/> + <source>Cannot process payment request because BIP70 is not supported.</source> <translation type="unfinished"></translation> </message> <message> - <location line="-37"/> - <location line="+38"/> + <location line="-22"/> + <location line="+23"/> <source>Due to widespread security flaws in BIP70 it's strongly recommended that any merchant instructions to switch wallets be ignored.</source> <translation type="unfinished"></translation> </message> <message> - <location line="-37"/> - <location line="+38"/> + <location line="-22"/> + <location line="+23"/> <source>If you are receiving this error you should request the merchant provide a BIP21 compatible URI.</source> <translation type="unfinished"></translation> </message> <message> - <location line="-34"/> + <location line="-20"/> <source>Invalid payment address %1</source> <translation type="unfinished"></translation> </message> @@ -1918,97 +1890,15 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+14"/> <location line="+9"/> <source>Payment request file handling</source> <translation type="unfinished"></translation> </message> - <message> - <location line="-8"/> - <source>Payment request file cannot be read! This can be caused by an invalid payment request file.</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+201"/> - <location line="+9"/> - <location line="+31"/> - <location line="+10"/> - <location line="+17"/> - <location line="+83"/> - <source>Payment request rejected</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="-150"/> - <source>Payment request network doesn't match client network.</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+9"/> - <source>Payment request expired.</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+6"/> - <source>Payment request is not initialized.</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+26"/> - <source>Unverified payment requests to custom payment scripts are unsupported.</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+9"/> - <location line="+17"/> - <source>Invalid payment request.</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="-10"/> - <source>Requested payment amount of %1 is too small (considered dust).</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+63"/> - <source>Refund from %1</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+31"/> - <source>Payment request %1 is too large (%2 bytes, allowed %3 bytes).</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+9"/> - <source>Error communicating with %1: %2</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+20"/> - <source>Payment request cannot be parsed!</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+13"/> - <source>Bad response from server %1</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+22"/> - <source>Network request error</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+6"/> - <source>Payment acknowledged</source> - <translation type="unfinished"></translation> - </message> </context> <context> <name>PeerTableModel</name> <message> - <location filename="../peertablemodel.cpp" line="+110"/> + <location filename="../peertablemodel.cpp" line="+107"/> <source>User Agent</source> <translation type="unfinished"></translation> </message> @@ -2046,12 +1936,12 @@ <translation type="unfinished">Amount</translation> </message> <message> - <location filename="../guiutil.cpp" line="+108"/> + <location filename="../guiutil.cpp" line="+111"/> <source>Enter a Bitcoin address (e.g. %1)</source> <translation type="unfinished"></translation> </message> <message> - <location line="+699"/> + <location line="+618"/> <source>%1 d</source> <translation type="unfinished"></translation> </message> @@ -2067,7 +1957,7 @@ </message> <message> <location line="+2"/> - <location line="+47"/> + <location line="+48"/> <source>%1 s</source> <translation type="unfinished"></translation> </message> @@ -2161,7 +2051,7 @@ <translation type="unfinished"></translation> </message> <message> - <location filename="../bitcoin.cpp" line="+118"/> + <location filename="../bitcoin.cpp" line="+114"/> <source>Error: Specified data directory "%1" does not exist.</source> <translation type="unfinished"></translation> </message> @@ -2176,7 +2066,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+64"/> + <location line="+65"/> <source>%1 didn't yet exit safely...</source> <translation type="unfinished"></translation> </message> @@ -2209,7 +2099,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+38"/> + <location line="+39"/> <source>QR code support not available.</source> <translation type="unfinished"></translation> </message> @@ -2271,12 +2161,7 @@ <translation>&Information</translation> </message> <message> - <location line="-29"/> - <source>Debug window</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+44"/> + <location line="+15"/> <source>General</source> <translation type="unfinished"></translation> </message> @@ -2390,7 +2275,7 @@ <message> <location line="+65"/> <location filename="../rpcconsole.cpp" line="+497"/> - <location line="+759"/> + <location line="+755"/> <source>Select a peer to view detailed information.</source> <translation type="unfinished"></translation> </message> @@ -2431,7 +2316,12 @@ <translation type="unfinished"></translation> </message> <message> - <location line="-737"/> + <location line="-1146"/> + <source>Node window</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+409"/> <source>Open the %1 debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation type="unfinished"></translation> </message> @@ -2521,7 +2411,7 @@ <translation type="unfinished"></translation> </message> <message> - <location filename="../rpcconsole.cpp" line="-411"/> + <location filename="../rpcconsole.cpp" line="-407"/> <source>In:</source> <translation type="unfinished"></translation> </message> @@ -2609,7 +2499,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+70"/> + <location line="+66"/> <source>Executing command without any wallet</source> <translation type="unfinished"></translation> </message> @@ -2680,13 +2570,11 @@ </message> <message> <location line="-3"/> - <location line="+46"/> <source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network.</source> <translation type="unfinished"></translation> </message> <message> - <location line="-30"/> - <location line="+14"/> + <location line="+30"/> <source>An optional label to associate with the new receiving address.</source> <translation type="unfinished"></translation> </message> @@ -2702,7 +2590,17 @@ <translation type="unfinished"></translation> </message> <message> - <location line="-76"/> + <location line="-121"/> + <source>An optional label to associate with the new receiving address (used by you to identify an invoice). It is also attached to the payment request.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+30"/> + <source>An optional message that is attached to the payment request and may be displayed to the sender.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+15"/> <source>&Create new receiving address</source> <translation type="unfinished"></translation> </message> @@ -2752,7 +2650,7 @@ <translation type="unfinished"></translation> </message> <message> - <location filename="../receivecoinsdialog.cpp" line="+46"/> + <location filename="../receivecoinsdialog.cpp" line="+45"/> <source>Copy URI</source> <translation type="unfinished"></translation> </message> @@ -2795,7 +2693,7 @@ <translation type="unfinished"></translation> </message> <message> - <location filename="../receiverequestdialog.cpp" line="+63"/> + <location filename="../receiverequestdialog.cpp" line="+64"/> <source>Request payment to %1</source> <translation type="unfinished"></translation> </message> @@ -2877,7 +2775,7 @@ <name>SendCoinsDialog</name> <message> <location filename="../forms/sendcoinsdialog.ui" line="+14"/> - <location filename="../sendcoinsdialog.cpp" line="+601"/> + <location filename="../sendcoinsdialog.cpp" line="+622"/> <source>Send Coins</source> <translation>Send Coins</translation> </message> @@ -2962,12 +2860,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+26"/> - <source>collapse fee-settings</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+51"/> + <location line="+77"/> <source>Specify a custom fee per kB (1,000 bytes) of the transaction's virtual size. Note: Since the fee is calculated on a per-byte basis, a fee of "100 satoshis per kB" for a transaction size of 500 bytes (half of 1 kB) would ultimately yield a fee of only 50 satoshis.</source> @@ -3019,7 +2912,12 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation type="unfinished"></translation> </message> <message> - <location line="+543"/> + <location line="+457"/> + <source>Hide transaction fee settings</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+86"/> <source>When there is less transaction volume than space in the blocks, miners as well as relaying nodes may enforce a minimum fee. Paying only this minimum fee is just fine, but be aware that this can result in a never confirming transaction once there is more demand for bitcoin transactions than the network can process.</source> <translation type="unfinished"></translation> </message> @@ -3064,7 +2962,7 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation>S&end</translation> </message> <message> - <location filename="../sendcoinsdialog.cpp" line="-513"/> + <location filename="../sendcoinsdialog.cpp" line="-533"/> <source>Copy quantity</source> <translation type="unfinished"></translation> </message> @@ -3104,29 +3002,47 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation type="unfinished"></translation> </message> <message> - <location line="+118"/> + <location line="+22"/> + <source>Cr&eate Unsigned</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Creates a Partially Signed Bitcoin Transaction (PSBT) for use with e.g. an offline %1 wallet, or a PSBT-compatible hardware wallet.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+100"/> <source> from wallet '%1'</source> <translation type="unfinished"></translation> </message> <message> - <location line="+14"/> <location line="+11"/> <source>%1 to '%2'</source> <translation type="unfinished"></translation> </message> <message> - <location line="-6"/> - <location line="+10"/> + <location line="+5"/> <source>%1 to %2</source> <translation type="unfinished"></translation> </message> <message> - <location line="+7"/> + <location line="+8"/> + <source>Do you want to draft this transaction?</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+2"/> <source>Are you sure you want to send?</source> <translation type="unfinished"></translation> </message> <message> - <location line="+42"/> + <location line="+5"/> + <source>Please, review your transaction proposal. This will produce a Partially Signed Bitcoin Transaction (PSBT) which you can copy and then sign with e.g. an offline %1 wallet, or a PSBT-compatible hardware wallet.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+43"/> <source>or</source> <translation type="unfinished"></translation> </message> @@ -3136,12 +3052,12 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation type="unfinished"></translation> </message> <message> - <location line="-21"/> + <location line="-22"/> <source>Please, review your transaction.</source> <translation type="unfinished"></translation> </message> <message> - <location line="+7"/> + <location line="+8"/> <source>Transaction fee</source> <translation type="unfinished"></translation> </message> @@ -3161,12 +3077,37 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation type="unfinished"></translation> </message> <message> - <location line="+6"/> + <location line="+5"/> <source>Confirm send coins</source> <translation type="unfinished"></translation> </message> <message> - <location line="+190"/> + <location line="+0"/> + <source>Confirm transaction proposal</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Copy PSBT to clipboard</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+0"/> + <source>Send</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+23"/> + <source>PSBT copied</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+166"/> + <source>Watch-only balance:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+24"/> <source>The recipient address is not valid. Please recheck.</source> <translation type="unfinished"></translation> </message> @@ -3197,11 +3138,6 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos </message> <message> <location line="+4"/> - <source>The transaction was rejected with the following reason: %1</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+4"/> <source>A fee higher than %1 is considered an absurdly high fee.</source> <translation type="unfinished"></translation> </message> @@ -3211,7 +3147,7 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation type="unfinished"></translation> </message> <message numerus="yes"> - <location line="+120"/> + <location line="+125"/> <source>Estimated to begin confirmation within %n block(s).</source> <translation> <numerusform>Estimated to begin confirmation within %n block.</numerusform> @@ -3248,13 +3184,13 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+155"/> - <location line="+546"/> + <location line="+550"/> <location line="+533"/> <source>A&mount:</source> <translation>A&mount:</translation> </message> <message> - <location line="-1192"/> + <location line="-1199"/> <source>Pay &To:</source> <translation>Pay &To:</translation> </message> @@ -3269,12 +3205,7 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation type="unfinished"></translation> </message> <message> - <location line="-46"/> - <source>This is a normal payment.</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+39"/> + <location line="-7"/> <source>The Bitcoin address to send the payment to</source> <translation type="unfinished"></translation> </message> @@ -3295,13 +3226,18 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos </message> <message> <location line="+7"/> - <location line="+555"/> + <location line="+562"/> <location line="+533"/> <source>Remove this entry</source> <translation type="unfinished"></translation> </message> <message> - <location line="-1028"/> + <location line="-1035"/> + <source>The amount to send in the selected unit</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+7"/> <source>The fee will be deducted from the amount being sent. The recipient will receive less bitcoins than you enter in the amount field. If multiple recipients are selected, the fee is split equally.</source> <translation type="unfinished"></translation> </message> @@ -3331,12 +3267,13 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation type="unfinished"></translation> </message> <message> - <location line="-1016"/> + <location line="-1023"/> + <location line="+3"/> <source>Enter a label for this address to add it to the list of used addresses</source> <translation type="unfinished"></translation> </message> <message> - <location line="+54"/> + <location line="+58"/> <source>A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network.</source> <translation type="unfinished"></translation> </message> @@ -3352,20 +3289,6 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <source>Memo:</source> <translation type="unfinished"></translation> </message> - <message> - <location filename="../sendcoinsentry.cpp" line="+39"/> - <source>Enter a label for this address to add it to your address book</source> - <translation type="unfinished"></translation> - </message> -</context> -<context> - <name>SendConfirmationDialog</name> - <message> - <location filename="../sendcoinsdialog.cpp" line="+88"/> - <location line="+5"/> - <source>Yes</source> - <translation type="unfinished"></translation> - </message> </context> <context> <name>ShutdownWindow</name> @@ -3404,18 +3327,18 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos </message> <message> <location line="+7"/> - <location line="+210"/> + <location line="+216"/> <source>Choose previously used address</source> <translation type="unfinished"></translation> </message> <message> - <location line="-200"/> - <location line="+210"/> + <location line="-206"/> + <location line="+216"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> - <location line="-200"/> + <location line="-206"/> <source>Paste address from clipboard</source> <translation>Paste address from clipboard</translation> </message> @@ -3426,6 +3349,7 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos </message> <message> <location line="+12"/> + <location line="+3"/> <source>Enter the message you want to sign here</source> <translation>Enter the message you want to sign here</translation> </message> @@ -3435,7 +3359,7 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation>Signature</translation> </message> <message> - <location line="+27"/> + <location line="+30"/> <source>Copy the current signature to the system clipboard</source> <translation>Copy the current signature to the system clipboard</translation> </message> @@ -3456,12 +3380,12 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos </message> <message> <location line="+3"/> - <location line="+143"/> + <location line="+157"/> <source>Clear &All</source> <translation>Clear &All</translation> </message> <message> - <location line="-84"/> + <location line="-98"/> <source>&Verify Message</source> <translation>&Verify Message</translation> </message> @@ -3476,7 +3400,19 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation type="unfinished"></translation> </message> <message> - <location line="+37"/> + <location line="+29"/> + <location line="+3"/> + <source>The signed message to verify</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+7"/> + <location line="+3"/> + <source>The signature given when the message was signed</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+9"/> <source>Verify the message to ensure it was signed with the specified Bitcoin address</source> <translation>Verify the message to ensure it was signed with the specified Bitcoin address</translation> </message> @@ -3491,63 +3427,68 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation>Reset all verify message fields</translation> </message> <message> - <location filename="../signverifymessagedialog.cpp" line="+39"/> + <location line="-210"/> <source>Click "Sign Message" to generate signature</source> <translation type="unfinished"></translation> </message> <message> - <location line="+81"/> - <location line="+78"/> + <location filename="../signverifymessagedialog.cpp" line="+117"/> + <location line="+99"/> <source>The entered address is invalid.</source> <translation type="unfinished"></translation> </message> <message> - <location line="-78"/> + <location line="-99"/> + <location line="+7"/> + <location line="+93"/> <location line="+7"/> - <location line="+71"/> - <location line="+6"/> <source>Please check the address and try again.</source> <translation type="unfinished"></translation> </message> <message> - <location line="-77"/> - <location line="+77"/> + <location line="-100"/> + <location line="+99"/> <source>The entered address does not refer to a key.</source> <translation type="unfinished"></translation> </message> <message> - <location line="-69"/> + <location line="-91"/> <source>Wallet unlock was cancelled.</source> <translation type="unfinished"></translation> </message> <message> - <location line="+8"/> + <location line="+11"/> + <source>No error</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> <source>Private key for the entered address is not available.</source> <translation type="unfinished"></translation> </message> <message> - <location line="+12"/> + <location line="+3"/> <source>Message signing failed.</source> <translation type="unfinished"></translation> </message> <message> - <location line="+5"/> + <location line="+12"/> <source>Message signed.</source> <translation type="unfinished"></translation> </message> <message> - <location line="+55"/> + <location line="+69"/> <source>The signature could not be decoded.</source> <translation type="unfinished"></translation> </message> <message> - <location line="+0"/> - <location line="+13"/> + <location line="+1"/> + <location line="+7"/> <source>Please check the signature and try again.</source> <translation type="unfinished"></translation> </message> <message> - <location line="+0"/> + <location line="-1"/> <source>The signature did not match the message digest.</source> <translation type="unfinished"></translation> </message> @@ -3557,7 +3498,7 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation type="unfinished"></translation> </message> <message> - <location line="+5"/> + <location line="-32"/> <source>Message verified.</source> <translation type="unfinished"></translation> </message> @@ -3621,7 +3562,7 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation type="unfinished"></translation> </message> <message> - <location line="+22"/> + <location line="+50"/> <source>Status</source> <translation type="unfinished"></translation> </message> @@ -3756,7 +3697,12 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation type="unfinished"></translation> </message> <message> - <location line="+19"/> + <location line="+16"/> + <source> (Certificate was not verified)</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> <source>Merchant</source> <translation type="unfinished"></translation> </message> @@ -3907,7 +3853,7 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation type="unfinished"></translation> </message> <message> - <location line="+15"/> + <location line="+16"/> <source>(n/a)</source> <translation type="unfinished"></translation> </message> @@ -4157,7 +4103,7 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <context> <name>WalletController</name> <message> - <location filename="../walletcontroller.cpp" line="-205"/> + <location filename="../walletcontroller.cpp" line="-211"/> <source>Close wallet</source> <translation type="unfinished"></translation> </message> @@ -4175,7 +4121,7 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <context> <name>WalletFrame</name> <message> - <location filename="../walletframe.cpp" line="+29"/> + <location filename="../walletframe.cpp" line="+28"/> <source>No wallet has been loaded.</source> <translation type="unfinished"></translation> </message> @@ -4183,28 +4129,34 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <context> <name>WalletModel</name> <message> - <location filename="../walletmodel.cpp" line="+219"/> + <location filename="../walletmodel.cpp" line="+198"/> <source>Send Coins</source> <translation type="unfinished">Send Coins</translation> </message> <message> - <location line="+309"/> - <location line="+39"/> + <location line="+288"/> + <location line="+45"/> + <location line="+13"/> <location line="+5"/> <source>Fee bump error</source> <translation type="unfinished"></translation> </message> <message> - <location line="-44"/> + <location line="-63"/> <source>Increasing transaction fee failed</source> <translation type="unfinished"></translation> </message> <message> - <location line="+6"/> + <location line="+8"/> <source>Do you want to increase the fee?</source> <translation type="unfinished"></translation> </message> <message> + <location line="+0"/> + <source>Do you want to draft a transaction with fee increase?</source> + <translation type="unfinished"></translation> + </message> + <message> <location line="+4"/> <source>Current fee:</source> <translation type="unfinished"></translation> @@ -4225,7 +4177,17 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation type="unfinished"></translation> </message> <message> - <location line="+17"/> + <location line="+21"/> + <source>Can't draft transaction.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+7"/> + <source>PSBT copied</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+6"/> <source>Can't sign transaction.</source> <translation type="unfinished"></translation> </message> @@ -4243,7 +4205,7 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <context> <name>WalletView</name> <message> - <location filename="../walletview.cpp" line="+47"/> + <location filename="../walletview.cpp" line="+46"/> <source>&Export</source> <translation type="unfinished">&Export</translation> </message> @@ -4253,7 +4215,7 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation type="unfinished">Export the data in the current tab to a file</translation> </message> <message> - <location line="+206"/> + <location line="+182"/> <source>Backup Wallet</source> <translation type="unfinished"></translation> </message> @@ -4306,12 +4268,7 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation type="unfinished"></translation> </message> <message> - <location line="+3"/> - <source>Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again.</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+70"/> + <location line="+68"/> <source>Error: A fatal internal error occurred, see debug.log for details</source> <translation type="unfinished"></translation> </message> @@ -4326,7 +4283,7 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation type="unfinished"></translation> </message> <message> - <location line="-167"/> + <location line="-162"/> <source>The %s developers</source> <translation type="unfinished"></translation> </message> @@ -4361,7 +4318,7 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation type="unfinished"></translation> </message> <message> - <location line="+11"/> + <location line="+8"/> <source>The block database contains a block which appears to be from the future. This may be due to your computer's date and time being set incorrectly. Only rebuild the block database if you are sure that your computer's date and time are correct</source> <translation type="unfinished"></translation> </message> @@ -4376,7 +4333,7 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation type="unfinished"></translation> </message> <message> - <location line="+12"/> + <location line="+8"/> <source>Unable to replay blocks. You will need to rebuild the database using -reindex-chainstate.</source> <translation type="unfinished"></translation> </message> @@ -4437,6 +4394,16 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos </message> <message> <location line="+1"/> + <source>Could not find asmap file %s</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Could not parse asmap file %s</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> <source>Do you want to rebuild the block database now?</source> <translation>Do you want to rebuild the block database now?</translation> </message> @@ -4631,7 +4598,7 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation type="unfinished"></translation> </message> <message> - <location line="-156"/> + <location line="-151"/> <source>Error: Listening for incoming connections failed (listen returned error %s)</source> <translation type="unfinished"></translation> </message> @@ -4641,17 +4608,17 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation type="unfinished"></translation> </message> <message> - <location line="+22"/> + <location line="+19"/> <source>The transaction amount is too small to send after the fee has been deducted</source> <translation type="unfinished"></translation> </message> <message> - <location line="+35"/> + <location line="+31"/> <source>You need to rebuild the database using -reindex to go back to unpruned mode. This will redownload the entire blockchain</source> <translation type="unfinished"></translation> </message> <message> - <location line="+25"/> + <location line="+27"/> <source>Error reading from database, shutting down.</source> <translation type="unfinished"></translation> </message> @@ -4787,22 +4754,17 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation type="unfinished"></translation> </message> <message> - <location line="-179"/> + <location line="-174"/> <source>-maxtxfee is set very high! Fees this large could be paid on a single transaction.</source> <translation type="unfinished"></translation> </message> <message> - <location line="+56"/> + <location line="+53"/> <source>This is the transaction fee you may pay when fee estimates are not available.</source> <translation type="unfinished"></translation> </message> <message> <location line="+2"/> - <source>This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit %s and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard.</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+4"/> <source>Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments.</source> <translation type="unfinished"></translation> </message> @@ -4817,7 +4779,7 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation type="unfinished"></translation> </message> <message> - <location line="+18"/> + <location line="+20"/> <source>Error loading wallet %s. Duplicate -wallet filename specified.</source> <translation type="unfinished"></translation> </message> @@ -4867,7 +4829,7 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation>Insufficient funds</translation> </message> <message> - <location line="-107"/> + <location line="-102"/> <source>Cannot upgrade a non HD split wallet without upgrading to support pre split keypool. Please use -upgradewallet=169900 or -upgradewallet with no version specified.</source> <translation type="unfinished"></translation> </message> @@ -4877,7 +4839,7 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation type="unfinished"></translation> </message> <message> - <location line="+48"/> + <location line="+41"/> <source>Warning: Private keys detected in wallet {%s} with disabled private keys</source> <translation type="unfinished"></translation> </message> @@ -4887,7 +4849,7 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation type="unfinished"></translation> </message> <message> - <location line="+37"/> + <location line="+39"/> <source>Loading block index...</source> <translation>Loading block index...</translation> </message> @@ -4897,12 +4859,12 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satos <translation>Loading wallet...</translation> </message> <message> - <location line="-40"/> + <location line="-42"/> <source>Cannot downgrade wallet</source> <translation>Cannot downgrade wallet</translation> </message> <message> - <location line="+49"/> + <location line="+51"/> <source>Rescanning...</source> <translation>Rescanning...</translation> </message> diff --git a/src/random.cpp b/src/random.cpp index f0082cf3e0..f7f3dd9de3 100644 --- a/src/random.cpp +++ b/src/random.cpp @@ -15,7 +15,7 @@ #endif #include <logging.h> // for LogPrintf() #include <sync.h> // for Mutex -#include <util/time.h> // for GetTime() +#include <util/time.h> // for GetTimeMicros() #include <stdlib.h> #include <thread> @@ -315,13 +315,10 @@ void GetOSRand(unsigned char *ent32) RandFailure(); } #elif defined(HAVE_GETENTROPY_RAND) && defined(MAC_OSX) - // We need a fallback for OSX < 10.12 - if (&getentropy != nullptr) { - if (getentropy(ent32, NUM_OS_RANDOM_BYTES) != 0) { - RandFailure(); - } - } else { - GetDevURandom(ent32); + /* getentropy() is available on macOS 10.12 and later. + */ + if (getentropy(ent32, NUM_OS_RANDOM_BYTES) != 0) { + RandFailure(); } #elif defined(HAVE_SYSCTL_ARND) /* FreeBSD and similar. It is possible for the call to return less diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index 133d1b809f..256876a3d1 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -345,7 +345,7 @@ static UniValue syncwithvalidationinterfacequeue(const JSONRPCRequest& request) RPCHelpMan{"syncwithvalidationinterfacequeue", "\nWaits for the validation interface queue to catch up on everything that was there when we entered this function.\n", {}, - RPCResults{}, + RPCResult{RPCResult::Type::NONE, "", ""}, RPCExamples{ HelpExampleCli("syncwithvalidationinterfacequeue","") + HelpExampleRpc("syncwithvalidationinterfacequeue","") @@ -1205,7 +1205,7 @@ UniValue getblockchaininfo(const JSONRPCRequest& request) {RPCResult::Type::NUM_TIME, "start_time", "the minimum median time past of a block at which the bit gains its meaning"}, {RPCResult::Type::NUM_TIME, "timeout", "the median time past of a block at which the deployment is considered failed if not yet locked in"}, {RPCResult::Type::NUM, "since", "height of the first block to which the status applies"}, - {RPCResult::Type::OBJ, "statistics", "numeric statistics about BIP9 signalling for a softfork", + {RPCResult::Type::OBJ, "statistics", "numeric statistics about BIP9 signalling for a softfork (only for \"started\" status)", { {RPCResult::Type::NUM, "period", "the length in blocks of the BIP9 signalling period"}, {RPCResult::Type::NUM, "threshold", "the number of blocks with the version bit set required to activate the feature"}, @@ -1435,7 +1435,7 @@ static UniValue preciousblock(const JSONRPCRequest& request) { {"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "the hash of the block to mark as precious"}, }, - RPCResults{}, + RPCResult{RPCResult::Type::NONE, "", ""}, RPCExamples{ HelpExampleCli("preciousblock", "\"blockhash\"") + HelpExampleRpc("preciousblock", "\"blockhash\"") @@ -1470,7 +1470,7 @@ static UniValue invalidateblock(const JSONRPCRequest& request) { {"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "the hash of the block to mark as invalid"}, }, - RPCResults{}, + RPCResult{RPCResult::Type::NONE, "", ""}, RPCExamples{ HelpExampleCli("invalidateblock", "\"blockhash\"") + HelpExampleRpc("invalidateblock", "\"blockhash\"") @@ -1509,7 +1509,7 @@ static UniValue reconsiderblock(const JSONRPCRequest& request) { {"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "the hash of the block to reconsider"}, }, - RPCResults{}, + RPCResult{RPCResult::Type::NONE, "", ""}, RPCExamples{ HelpExampleCli("reconsiderblock", "\"blockhash\"") + HelpExampleRpc("reconsiderblock", "\"blockhash\"") @@ -1933,7 +1933,7 @@ static UniValue savemempool(const JSONRPCRequest& request) RPCHelpMan{"savemempool", "\nDumps the mempool to disk. It will fail until the previous dump is fully loaded.\n", {}, - RPCResults{}, + RPCResult{RPCResult::Type::NONE, "", ""}, RPCExamples{ HelpExampleCli("savemempool", "") + HelpExampleRpc("savemempool", "") diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index 92440488a4..1bbb5c4bee 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -751,7 +751,7 @@ static UniValue submitblock(const JSONRPCRequest& request) {"hexdata", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "the hex-encoded block data to submit"}, {"dummy", RPCArg::Type::STR, /* default */ "ignored", "dummy value, for compatibility with BIP22. This value is ignored."}, }, - RPCResults{}, + RPCResult{RPCResult::Type::NONE, "", "Returns JSON Null when valid, a string according to BIP22 otherwise"}, RPCExamples{ HelpExampleCli("submitblock", "\"mydata\"") + HelpExampleRpc("submitblock", "\"mydata\"") diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp index 4b16dd21a0..c87c1a5418 100644 --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -347,7 +347,7 @@ static UniValue setmocktime(const JSONRPCRequest& request) {"timestamp", RPCArg::Type::NUM, RPCArg::Optional::NO, UNIX_EPOCH_TIME + "\n" " Pass 0 to go back to using the system time."}, }, - RPCResults{}, + RPCResult{RPCResult::Type::NONE, "", ""}, RPCExamples{""}, }.Check(request); @@ -375,7 +375,7 @@ static UniValue mockscheduler(const JSONRPCRequest& request) { {"delta_time", RPCArg::Type::NUM, RPCArg::Optional::NO, "Number of seconds to forward the scheduler into the future." }, }, - RPCResults{}, + RPCResult{RPCResult::Type::NONE, "", ""}, RPCExamples{""}, }.Check(request); @@ -579,7 +579,7 @@ static UniValue echo(const JSONRPCRequest& request) "\nThe difference between echo and echojson is that echojson has argument conversion enabled in the client-side table in " "bitcoin-cli and the GUI. There is no server-side difference.", {}, - RPCResults{}, + RPCResult{RPCResult::Type::NONE, "", "Returns whatever was passed in"}, RPCExamples{""}, }.ToString() ); diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp index eeb617f849..e26ca1b07a 100644 --- a/src/rpc/net.cpp +++ b/src/rpc/net.cpp @@ -54,7 +54,7 @@ static UniValue ping(const JSONRPCRequest& request) "Results provided in getpeerinfo, pingtime and pingwait fields are decimal seconds.\n" "Ping command is handled in queue with all other commands, so it measures processing backlog, not just network ping.\n", {}, - RPCResults{}, + RPCResult{RPCResult::Type::NONE, "", ""}, RPCExamples{ HelpExampleCli("ping", "") + HelpExampleRpc("ping", "") @@ -240,7 +240,7 @@ static UniValue addnode(const JSONRPCRequest& request) {"node", RPCArg::Type::STR, RPCArg::Optional::NO, "The node (see getpeerinfo for nodes)"}, {"command", RPCArg::Type::STR, RPCArg::Optional::NO, "'add' to add a node to the list, 'remove' to remove a node from the list, 'onetry' to try a connection to the node once"}, }, - RPCResults{}, + RPCResult{RPCResult::Type::NONE, "", ""}, RPCExamples{ HelpExampleCli("addnode", "\"192.168.0.6:8333\" \"onetry\"") + HelpExampleRpc("addnode", "\"192.168.0.6:8333\", \"onetry\"") @@ -283,7 +283,7 @@ static UniValue disconnectnode(const JSONRPCRequest& request) {"address", RPCArg::Type::STR, /* default */ "fallback to nodeid", "The IP address/port of the node"}, {"nodeid", RPCArg::Type::NUM, /* default */ "fallback to address", "The node ID (see getpeerinfo for node IDs)"}, }, - RPCResults{}, + RPCResult{RPCResult::Type::NONE, "", ""}, RPCExamples{ HelpExampleCli("disconnectnode", "\"192.168.0.6:8333\"") + HelpExampleCli("disconnectnode", "\"\" 1") @@ -553,7 +553,7 @@ static UniValue setban(const JSONRPCRequest& request) {"bantime", RPCArg::Type::NUM, /* default */ "0", "time in seconds how long (or until when if [absolute] is set) the IP is banned (0 or empty means using the default time of 24h which can also be overwritten by the -bantime startup argument)"}, {"absolute", RPCArg::Type::BOOL, /* default */ "false", "If set, the bantime must be an absolute timestamp expressed in " + UNIX_EPOCH_TIME}, }, - RPCResults{}, + RPCResult{RPCResult::Type::NONE, "", ""}, RPCExamples{ HelpExampleCli("setban", "\"192.168.0.6\" \"add\" 86400") + HelpExampleCli("setban", "\"192.168.0.0/24\" \"add\"") @@ -628,7 +628,16 @@ static UniValue listbanned(const JSONRPCRequest& request) RPCHelpMan{"listbanned", "\nList all banned IPs/Subnets.\n", {}, - RPCResults{}, + RPCResult{RPCResult::Type::ARR, "", "", + { + {RPCResult::Type::OBJ, "", "", + { + {RPCResult::Type::STR, "address", ""}, + {RPCResult::Type::NUM_TIME, "banned_until", ""}, + {RPCResult::Type::NUM_TIME, "ban_created", ""}, + {RPCResult::Type::STR, "ban_reason", ""}, + }}, + }}, RPCExamples{ HelpExampleCli("listbanned", "") + HelpExampleRpc("listbanned", "") @@ -663,7 +672,7 @@ static UniValue clearbanned(const JSONRPCRequest& request) RPCHelpMan{"clearbanned", "\nClear all banned IPs.\n", {}, - RPCResults{}, + RPCResult{RPCResult::Type::NONE, "", ""}, RPCExamples{ HelpExampleCli("clearbanned", "") + HelpExampleRpc("clearbanned", "") @@ -685,7 +694,7 @@ static UniValue setnetworkactive(const JSONRPCRequest& request) { {"state", RPCArg::Type::BOOL, RPCArg::Optional::NO, "true to enable networking, false to disable"}, }, - RPCResults{}, + RPCResult{RPCResult::Type::BOOL, "", "The value that was passed in"}, RPCExamples{""}, }.Check(request); diff --git a/src/rpc/server.cpp b/src/rpc/server.cpp index 2893aa0e60..e2618c16da 100644 --- a/src/rpc/server.cpp +++ b/src/rpc/server.cpp @@ -153,6 +153,7 @@ UniValue help(const JSONRPCRequest& jsonRequest) UniValue stop(const JSONRPCRequest& jsonRequest) { + static const std::string RESULT{PACKAGE_NAME " stopping"}; // Accept the deprecated and ignored 'detach' boolean argument // Also accept the hidden 'wait' integer argument (milliseconds) // For instance, 'stop 1000' makes the call wait 1 second before returning @@ -162,7 +163,7 @@ UniValue stop(const JSONRPCRequest& jsonRequest) RPCHelpMan{"stop", "\nRequest a graceful shutdown of " PACKAGE_NAME ".", {}, - RPCResults{}, + RPCResult{RPCResult::Type::STR, "", "A string with the content '" + RESULT + "'"}, RPCExamples{""}, }.ToString()); // Event loop will exit after current HTTP requests have been handled, so @@ -171,7 +172,7 @@ UniValue stop(const JSONRPCRequest& jsonRequest) if (jsonRequest.params[0].isNum()) { UninterruptibleSleep(std::chrono::milliseconds{jsonRequest.params[0].get_int()}); } - return PACKAGE_NAME " stopping"; + return RESULT; } static UniValue uptime(const JSONRPCRequest& jsonRequest) diff --git a/src/rpc/util.h b/src/rpc/util.h index 5813df507f..f65ad1246b 100644 --- a/src/rpc/util.h +++ b/src/rpc/util.h @@ -290,11 +290,6 @@ struct RPCResult { struct RPCResults { const std::vector<RPCResult> m_results; - RPCResults() - : m_results{} - { - } - RPCResults(RPCResult result) : m_results{{result}} { diff --git a/src/sync.h b/src/sync.h index 204734c273..ead2cdc67b 100644 --- a/src/sync.h +++ b/src/sync.h @@ -10,9 +10,9 @@ #include <util/macros.h> #include <condition_variable> -#include <thread> #include <mutex> - +#include <string> +#include <thread> //////////////////////////////////////////////// // // diff --git a/src/test/denialofservice_tests.cpp b/src/test/denialofservice_tests.cpp index e5d51ab83b..73bce6f789 100644 --- a/src/test/denialofservice_tests.cpp +++ b/src/test/denialofservice_tests.cpp @@ -78,7 +78,7 @@ BOOST_FIXTURE_TEST_SUITE(denialofservice_tests, TestingSetup) BOOST_AUTO_TEST_CASE(outbound_slow_chain_eviction) { auto connman = MakeUnique<CConnman>(0x1337, 0x1337); - auto peerLogic = MakeUnique<PeerLogicValidation>(connman.get(), nullptr, *m_node.scheduler); + auto peerLogic = MakeUnique<PeerLogicValidation>(connman.get(), nullptr, *m_node.scheduler, *m_node.mempool); // Mock an outbound peer CAddress addr1(ip(0xa0b0c001), NODE_NONE); @@ -148,7 +148,7 @@ static void AddRandomOutboundPeer(std::vector<CNode *> &vNodes, PeerLogicValidat BOOST_AUTO_TEST_CASE(stale_tip_peer_management) { auto connman = MakeUnique<CConnmanTest>(0x1337, 0x1337); - auto peerLogic = MakeUnique<PeerLogicValidation>(connman.get(), nullptr, *m_node.scheduler); + auto peerLogic = MakeUnique<PeerLogicValidation>(connman.get(), nullptr, *m_node.scheduler, *m_node.mempool); const Consensus::Params& consensusParams = Params().GetConsensus(); constexpr int max_outbound_full_relay = 8; @@ -221,7 +221,7 @@ BOOST_AUTO_TEST_CASE(DoS_banning) { auto banman = MakeUnique<BanMan>(GetDataDir() / "banlist.dat", nullptr, DEFAULT_MISBEHAVING_BANTIME); auto connman = MakeUnique<CConnman>(0x1337, 0x1337); - auto peerLogic = MakeUnique<PeerLogicValidation>(connman.get(), banman.get(), *m_node.scheduler); + auto peerLogic = MakeUnique<PeerLogicValidation>(connman.get(), banman.get(), *m_node.scheduler, *m_node.mempool); banman->ClearBanned(); CAddress addr1(ip(0xa0b0c001), NODE_NONE); @@ -276,7 +276,7 @@ BOOST_AUTO_TEST_CASE(DoS_banscore) { auto banman = MakeUnique<BanMan>(GetDataDir() / "banlist.dat", nullptr, DEFAULT_MISBEHAVING_BANTIME); auto connman = MakeUnique<CConnman>(0x1337, 0x1337); - auto peerLogic = MakeUnique<PeerLogicValidation>(connman.get(), banman.get(), *m_node.scheduler); + auto peerLogic = MakeUnique<PeerLogicValidation>(connman.get(), banman.get(), *m_node.scheduler, *m_node.mempool); banman->ClearBanned(); gArgs.ForceSetArg("-banscore", "111"); // because 11 is my favorite number @@ -323,7 +323,7 @@ BOOST_AUTO_TEST_CASE(DoS_bantime) { auto banman = MakeUnique<BanMan>(GetDataDir() / "banlist.dat", nullptr, DEFAULT_MISBEHAVING_BANTIME); auto connman = MakeUnique<CConnman>(0x1337, 0x1337); - auto peerLogic = MakeUnique<PeerLogicValidation>(connman.get(), banman.get(), *m_node.scheduler); + auto peerLogic = MakeUnique<PeerLogicValidation>(connman.get(), banman.get(), *m_node.scheduler, *m_node.mempool); banman->ClearBanned(); int64_t nStartTime = GetTime(); diff --git a/src/test/fuzz/process_message.cpp b/src/test/fuzz/process_message.cpp index 934f741068..dc49dd499a 100644 --- a/src/test/fuzz/process_message.cpp +++ b/src/test/fuzz/process_message.cpp @@ -32,7 +32,7 @@ #include <string> #include <vector> -bool ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStream& vRecv, int64_t nTimeReceived, const CChainParams& chainparams, CConnman* connman, BanMan* banman, const std::atomic<bool>& interruptMsgProc); +bool ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStream& vRecv, int64_t nTimeReceived, const CChainParams& chainparams, CTxMemPool& mempool, CConnman* connman, BanMan* banman, const std::atomic<bool>& interruptMsgProc); namespace { @@ -85,7 +85,7 @@ void test_one_input(const std::vector<uint8_t>& buffer) p2p_node.SetSendVersion(PROTOCOL_VERSION); g_setup->m_node.peer_logic->InitializeNode(&p2p_node); try { - (void)ProcessMessage(&p2p_node, random_message_type, random_bytes_data_stream, GetTimeMillis(), Params(), g_setup->m_node.connman.get(), g_setup->m_node.banman.get(), std::atomic<bool>{false}); + (void)ProcessMessage(&p2p_node, random_message_type, random_bytes_data_stream, GetTimeMillis(), Params(), *g_setup->m_node.mempool, g_setup->m_node.connman.get(), g_setup->m_node.banman.get(), std::atomic<bool>{false}); } catch (const std::ios_base::failure& e) { const std::string exception_message{e.what()}; const auto p = EXPECTED_DESERIALIZATION_EXCEPTIONS.find(exception_message); diff --git a/src/test/util/setup_common.cpp b/src/test/util/setup_common.cpp index ad3ff48860..e19a96eafc 100644 --- a/src/test/util/setup_common.cpp +++ b/src/test/util/setup_common.cpp @@ -137,7 +137,7 @@ TestingSetup::TestingSetup(const std::string& chainName) : BasicTestingSetup(cha m_node.mempool->setSanityCheck(1.0); m_node.banman = MakeUnique<BanMan>(GetDataDir() / "banlist.dat", nullptr, DEFAULT_MISBEHAVING_BANTIME); m_node.connman = MakeUnique<CConnman>(0x1337, 0x1337); // Deterministic randomness for tests. - m_node.peer_logic = MakeUnique<PeerLogicValidation>(m_node.connman.get(), m_node.banman.get(), *m_node.scheduler); + m_node.peer_logic = MakeUnique<PeerLogicValidation>(m_node.connman.get(), m_node.banman.get(), *m_node.scheduler, *m_node.mempool); } TestingSetup::~TestingSetup() diff --git a/src/validation.cpp b/src/validation.cpp index c0327c39bc..a5b68e4ebd 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -974,7 +974,7 @@ bool MemPoolAccept::Finalize(ATMPArgs& args, Workspace& ws) // Remove conflicting transactions from the mempool for (CTxMemPool::txiter it : allConflicting) { - LogPrint(BCLog::MEMPOOL, "replacing tx %s with %s for %s BTC additional fees, %d delta bytes\n", + LogPrint(BCLog::MEMPOOL, "replacing tx %s with %s for %s additional fees, %d delta bytes\n", it->GetTx().GetHash().ToString(), hash.ToString(), FormatMoney(nModifiedFees - nConflictingFees), diff --git a/src/wallet/rpcdump.cpp b/src/wallet/rpcdump.cpp index 8df3491060..e4d0a3fa6d 100644 --- a/src/wallet/rpcdump.cpp +++ b/src/wallet/rpcdump.cpp @@ -106,7 +106,7 @@ UniValue importprivkey(const JSONRPCRequest& request) {"label", RPCArg::Type::STR, /* default */ "current label if address exists, otherwise \"\"", "An optional label"}, {"rescan", RPCArg::Type::BOOL, /* default */ "true", "Rescan the wallet for transactions"}, }, - RPCResults{}, + RPCResult{RPCResult::Type::NONE, "", ""}, RPCExamples{ "\nDump a private key\n" + HelpExampleCli("dumpprivkey", "\"myaddress\"") + @@ -203,7 +203,7 @@ UniValue abortrescan(const JSONRPCRequest& request) "\nStops current wallet rescan triggered by an RPC call, e.g. by an importprivkey call.\n" "Note: Use \"getwalletinfo\" to query the scanning progress.\n", {}, - RPCResults{}, + RPCResult{RPCResult::Type::BOOL, "", "Whether the abort was successful"}, RPCExamples{ "\nImport a private key\n" + HelpExampleCli("importprivkey", "\"mykey\"") + @@ -242,7 +242,7 @@ UniValue importaddress(const JSONRPCRequest& request) {"rescan", RPCArg::Type::BOOL, /* default */ "true", "Rescan the wallet for transactions"}, {"p2sh", RPCArg::Type::BOOL, /* default */ "false", "Add the P2SH version of the script as well"}, }, - RPCResults{}, + RPCResult{RPCResult::Type::NONE, "", ""}, RPCExamples{ "\nImport an address with rescan\n" + HelpExampleCli("importaddress", "\"myaddress\"") + @@ -337,7 +337,7 @@ UniValue importprunedfunds(const JSONRPCRequest& request) {"rawtransaction", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "A raw transaction in hex funding an already-existing address in wallet"}, {"txoutproof", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The hex output from gettxoutproof that contains the transaction"}, }, - RPCResults{}, + RPCResult{RPCResult::Type::NONE, "", ""}, RPCExamples{""}, }.Check(request); @@ -397,7 +397,7 @@ UniValue removeprunedfunds(const JSONRPCRequest& request) { {"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The hex-encoded id of the transaction you are deleting"}, }, - RPCResults{}, + RPCResult{RPCResult::Type::NONE, "", ""}, RPCExamples{ HelpExampleCli("removeprunedfunds", "\"a8d0c0184dde994a09ec054286f1ce581bebf46446a512166eae7628734ea0a5\"") + "\nAs a JSON-RPC call\n" @@ -443,7 +443,7 @@ UniValue importpubkey(const JSONRPCRequest& request) {"label", RPCArg::Type::STR, /* default */ "\"\"", "An optional label"}, {"rescan", RPCArg::Type::BOOL, /* default */ "true", "Rescan the wallet for transactions"}, }, - RPCResults{}, + RPCResult{RPCResult::Type::NONE, "", ""}, RPCExamples{ "\nImport a public key with rescan\n" + HelpExampleCli("importpubkey", "\"mypubkey\"") + @@ -527,7 +527,7 @@ UniValue importwallet(const JSONRPCRequest& request) { {"filename", RPCArg::Type::STR, RPCArg::Optional::NO, "The wallet file"}, }, - RPCResults{}, + RPCResult{RPCResult::Type::NONE, "", ""}, RPCExamples{ "\nDump the wallet\n" + HelpExampleCli("dumpwallet", "\"test\"") + diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 24df947405..a913aa3024 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -301,7 +301,7 @@ static UniValue setlabel(const JSONRPCRequest& request) {"address", RPCArg::Type::STR, RPCArg::Optional::NO, "The bitcoin address to be associated with a label."}, {"label", RPCArg::Type::STR, RPCArg::Optional::NO, "The label to assign to the address."}, }, - RPCResults{}, + RPCResult{RPCResult::Type::NONE, "", ""}, RPCExamples{ HelpExampleCli("setlabel", "\"" + EXAMPLE_ADDRESS[0] + "\" \"tabby\"") + HelpExampleRpc("setlabel", "\"" + EXAMPLE_ADDRESS[0] + "\", \"tabby\"") @@ -784,7 +784,7 @@ static UniValue getunconfirmedbalance(const JSONRPCRequest &request) RPCHelpMan{"getunconfirmedbalance", "DEPRECATED\nIdentical to getbalances().mine.untrusted_pending\n", {}, - RPCResults{}, + RPCResult{RPCResult::Type::NUM, "", "The balance"}, RPCExamples{""}, }.Check(request); @@ -1776,7 +1776,7 @@ static UniValue abandontransaction(const JSONRPCRequest& request) { {"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The transaction id"}, }, - RPCResults{}, + RPCResult{RPCResult::Type::NONE, "", ""}, RPCExamples{ HelpExampleCli("abandontransaction", "\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"") + HelpExampleRpc("abandontransaction", "\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"") @@ -1817,7 +1817,7 @@ static UniValue backupwallet(const JSONRPCRequest& request) { {"destination", RPCArg::Type::STR, RPCArg::Optional::NO, "The destination directory or file"}, }, - RPCResults{}, + RPCResult{RPCResult::Type::NONE, "", ""}, RPCExamples{ HelpExampleCli("backupwallet", "\"backup.dat\"") + HelpExampleRpc("backupwallet", "\"backup.dat\"") @@ -1855,7 +1855,7 @@ static UniValue keypoolrefill(const JSONRPCRequest& request) { {"newsize", RPCArg::Type::NUM, /* default */ "100", "The new keypool size"}, }, - RPCResults{}, + RPCResult{RPCResult::Type::NONE, "", ""}, RPCExamples{ HelpExampleCli("keypoolrefill", "") + HelpExampleRpc("keypoolrefill", "") @@ -1907,7 +1907,7 @@ static UniValue walletpassphrase(const JSONRPCRequest& request) {"passphrase", RPCArg::Type::STR, RPCArg::Optional::NO, "The wallet passphrase"}, {"timeout", RPCArg::Type::NUM, RPCArg::Optional::NO, "The time to keep the decryption key in seconds; capped at 100000000 (~3 years)."}, }, - RPCResults{}, + RPCResult{RPCResult::Type::NONE, "", ""}, RPCExamples{ "\nUnlock the wallet for 60 seconds\n" + HelpExampleCli("walletpassphrase", "\"my pass phrase\" 60") + @@ -1987,7 +1987,7 @@ static UniValue walletpassphrasechange(const JSONRPCRequest& request) {"oldpassphrase", RPCArg::Type::STR, RPCArg::Optional::NO, "The current passphrase"}, {"newpassphrase", RPCArg::Type::STR, RPCArg::Optional::NO, "The new passphrase"}, }, - RPCResults{}, + RPCResult{RPCResult::Type::NONE, "", ""}, RPCExamples{ HelpExampleCli("walletpassphrasechange", "\"old one\" \"new one\"") + HelpExampleRpc("walletpassphrasechange", "\"old one\", \"new one\"") @@ -2037,7 +2037,7 @@ static UniValue walletlock(const JSONRPCRequest& request) "After calling this method, you will need to call walletpassphrase again\n" "before being able to call any methods which require the wallet to be unlocked.\n", {}, - RPCResults{}, + RPCResult{RPCResult::Type::NONE, "", ""}, RPCExamples{ "\nSet the passphrase for 2 minutes to perform a transaction\n" + HelpExampleCli("walletpassphrase", "\"my pass phrase\" 120") + @@ -2082,7 +2082,7 @@ static UniValue encryptwallet(const JSONRPCRequest& request) { {"passphrase", RPCArg::Type::STR, RPCArg::Optional::NO, "The pass phrase to encrypt the wallet with. It must be at least 1 character, but should be long."}, }, - RPCResults{}, + RPCResult{RPCResult::Type::STR, "", "A string with further instructions"}, RPCExamples{ "\nEncrypt your wallet\n" + HelpExampleCli("encryptwallet", "\"my pass phrase\"") + @@ -2767,7 +2767,7 @@ static UniValue unloadwallet(const JSONRPCRequest& request) { {"wallet_name", RPCArg::Type::STR, /* default */ "the wallet name from the RPC request", "The name of the wallet to unload."}, }, - RPCResults{}, + RPCResult{RPCResult::Type::NONE, "", ""}, RPCExamples{ HelpExampleCli("unloadwallet", "wallet_name") + HelpExampleRpc("unloadwallet", "wallet_name") @@ -2851,9 +2851,9 @@ static UniValue listunspent(const JSONRPCRequest& request) {RPCResult::Type::BOOL, "solvable", "Whether we know how to spend this output, ignoring the lack of keys"}, {RPCResult::Type::BOOL, "reused", "(only present if avoid_reuse is set) Whether this output is reused/dirty (sent to an address that was previously spent from)"}, {RPCResult::Type::STR, "desc", "(only when solvable) A descriptor for spending this output"}, - {RPCResult::Type::BOOL, "safe", "Whether this output is considered safe to spend. Unconfirmed transactions" - " from outside keys and unconfirmed replacement transactions are considered unsafe\n" - "and are not eligible for spending by fundrawtransaction and sendtoaddress."}, + {RPCResult::Type::BOOL, "safe", "Whether this output is considered safe to spend. Unconfirmed transactions\n" + "from outside keys and unconfirmed replacement transactions are considered unsafe\n" + "and are not eligible for spending by fundrawtransaction and sendtoaddress."}, }}, } }, @@ -3361,7 +3361,7 @@ static UniValue bumpfee(const JSONRPCRequest& request) " the dust threshold."}, {"fee_rate", RPCArg::Type::NUM, /* default */ "fallback to 'confTarget'", "FeeRate (NOT total fee) to pay, in " + CURRENCY_UNIT + " per kB\n" " Specify a fee rate instead of relying on the built-in fee estimator.\n" - " Must be at least 0.0001 BTC per kB higher than the current transaction fee rate.\n"}, + "Must be at least 0.0001 " + CURRENCY_UNIT + " per kB higher than the current transaction fee rate.\n"}, {"replaceable", RPCArg::Type::BOOL, /* default */ "true", "Whether the new transaction should still be\n" " marked bip-125 replaceable. If true, the sequence numbers in the transaction will\n" " be left unchanged from the original. If false, any input sequence numbers in the\n" @@ -4013,7 +4013,7 @@ UniValue sethdseed(const JSONRPCRequest& request) {"seed", RPCArg::Type::STR, /* default */ "random seed", "The WIF private key to use as the new HD seed.\n" " The seed value can be retrieved using the dumpwallet command. It is the private key marked hdseed=1"}, }, - RPCResults{}, + RPCResult{RPCResult::Type::NONE, "", ""}, RPCExamples{ HelpExampleCli("sethdseed", "") + HelpExampleCli("sethdseed", "false") |