diff --git a/.arclint b/.arclint --- a/.arclint +++ b/.arclint @@ -5,8 +5,8 @@ }, "clang-format": { "type": "clang-format", - "version": "4.0", - "bin": ["clang-format-4.0", "clang-format"], + "version": "7.0", + "bin": ["clang-format-7", "clang-format"], "include": "(^src/.*\\.(h|c|cpp)$)", "exclude": [ "(^src/(secp256k1|univalue|leveldb)/)" diff --git a/src/.clang-format b/src/.clang-format --- a/src/.clang-format +++ b/src/.clang-format @@ -9,6 +9,10 @@ NamespaceIndentation: Inner BreakBeforeBraces: Attach ReflowComments: true +AlignEscapedNewlines: Right +AllowShortBlocksOnASingleLine: false AllowShortIfStatementsOnASingleLine: true AllowShortFunctionsOnASingleLine: Inline +FixNamespaceComments: false +ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH, BOOST_REVERSE_FOREACH ] CommentPragmas: '@DISABLE FORMATING FOR THIS COMMENT@' diff --git a/src/addrman.h b/src/addrman.h --- a/src/addrman.h +++ b/src/addrman.h @@ -489,8 +489,9 @@ } } if (nLost + nLostUnk > 0) { - LogPrint(BCLog::ADDRMAN, "addrman lost %i new and %i tried " - "addresses due to collisions\n", + LogPrint(BCLog::ADDRMAN, + "addrman lost %i new and %i tried addresses due to " + "collisions\n", nLostUnk, nLost); } diff --git a/src/addrman.cpp b/src/addrman.cpp --- a/src/addrman.cpp +++ b/src/addrman.cpp @@ -272,9 +272,9 @@ // Will moving this address into tried evict another entry? if (test_before_evict && (vvTried[tried_bucket][tried_bucket_pos] != -1)) { - LogPrint(BCLog::ADDRMAN, "Collision inserting element into " - "tried table, moving %s to " - "m_tried_collisions=%d\n", + LogPrint(BCLog::ADDRMAN, + "Collision inserting element into tried table, moving %s to " + "m_tried_collisions=%d\n", addr.ToString(), m_tried_collisions.size()); if (m_tried_collisions.size() < ADDRMAN_SET_TRIED_COLLISION_SIZE) { m_tried_collisions.insert(nId); @@ -413,14 +413,12 @@ int nKBucket = RandomInt(ADDRMAN_TRIED_BUCKET_COUNT); int nKBucketPos = RandomInt(ADDRMAN_BUCKET_SIZE); while (vvTried[nKBucket][nKBucketPos] == -1) { - nKBucket = - (nKBucket + - insecure_rand.randbits(ADDRMAN_TRIED_BUCKET_COUNT_LOG2)) % - ADDRMAN_TRIED_BUCKET_COUNT; - nKBucketPos = - (nKBucketPos + - insecure_rand.randbits(ADDRMAN_BUCKET_SIZE_LOG2)) % - ADDRMAN_BUCKET_SIZE; + nKBucket = (nKBucket + insecure_rand.randbits( + ADDRMAN_TRIED_BUCKET_COUNT_LOG2)) % + ADDRMAN_TRIED_BUCKET_COUNT; + nKBucketPos = (nKBucketPos + insecure_rand.randbits( + ADDRMAN_BUCKET_SIZE_LOG2)) % + ADDRMAN_BUCKET_SIZE; } int nId = vvTried[nKBucket][nKBucketPos]; assert(mapInfo.count(nId) == 1); @@ -438,14 +436,12 @@ int nUBucket = RandomInt(ADDRMAN_NEW_BUCKET_COUNT); int nUBucketPos = RandomInt(ADDRMAN_BUCKET_SIZE); while (vvNew[nUBucket][nUBucketPos] == -1) { - nUBucket = - (nUBucket + - insecure_rand.randbits(ADDRMAN_NEW_BUCKET_COUNT_LOG2)) % - ADDRMAN_NEW_BUCKET_COUNT; - nUBucketPos = - (nUBucketPos + - insecure_rand.randbits(ADDRMAN_BUCKET_SIZE_LOG2)) % - ADDRMAN_BUCKET_SIZE; + nUBucket = (nUBucket + insecure_rand.randbits( + ADDRMAN_NEW_BUCKET_COUNT_LOG2)) % + ADDRMAN_NEW_BUCKET_COUNT; + nUBucketPos = (nUBucketPos + insecure_rand.randbits( + ADDRMAN_BUCKET_SIZE_LOG2)) % + ADDRMAN_BUCKET_SIZE; } int nId = vvNew[nUBucket][nUBucketPos]; assert(mapInfo.count(nId) == 1); diff --git a/src/avalanche.cpp b/src/avalanche.cpp --- a/src/avalanche.cpp +++ b/src/avalanche.cpp @@ -227,9 +227,9 @@ // This item has note been finalized, so we have nothing more to // do. updates.emplace_back( - pindex, - vr.isAccepted() ? AvalancheBlockUpdate::Status::Accepted - : AvalancheBlockUpdate::Status::Rejected); + pindex, vr.isAccepted() + ? AvalancheBlockUpdate::Status::Accepted + : AvalancheBlockUpdate::Status::Rejected); continue; } diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -100,15 +100,17 @@ "outmultisig=VALUE:REQUIRED:PUBKEYS:PUBKEY1:PUBKEY2:....[:FLAGS]", _("Add Pay To n-of-m Multi-sig output to TX. n = REQUIRED, m = " "PUBKEYS") + - ". " + _("Optionally add the \"S\" flag to wrap the output in " - "a pay-to-script-hash.")); + ". " + + _("Optionally add the \"S\" flag to wrap the output in a " + "pay-to-script-hash.")); strUsage += HelpMessageOpt( "sign=SIGHASH-FLAGS", _("Add zero or more signatures to transaction") + ". " + _("This command requires JSON registers:") + _("prevtxs=JSON object") + ", " + _("privatekeys=JSON object") + - ". " + _("See signrawtransaction docs for format of sighash " - "flags, JSON objects.")); + ". " + + _("See signrawtransaction docs for format of sighash flags, " + "JSON objects.")); fprintf(stdout, "%s", strUsage.c_str()); strUsage = HelpMessageGroup(_("Register Commands:")); diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -120,9 +120,9 @@ // line for (int i = 1; i < argc; i++) { if (!IsSwitchChar(argv[i][0])) { - fprintf(stderr, "Error: Command line contains unexpected token " - "'%s', see bitcoind -h for a list of " - "options.\n", + fprintf(stderr, + "Error: Command line contains unexpected token '%s', " + "see bitcoind -h for a list of options.\n", argv[i]); exit(EXIT_FAILURE); } diff --git a/src/blockencodings.cpp b/src/blockencodings.cpp --- a/src/blockencodings.cpp +++ b/src/blockencodings.cpp @@ -195,8 +195,9 @@ } } - LogPrint(BCLog::CMPCTBLOCK, "Initialized PartiallyDownloadedBlock for " - "block %s using a cmpctblock of size %lu\n", + LogPrint(BCLog::CMPCTBLOCK, + "Initialized PartiallyDownloadedBlock for block %s using a " + "cmpctblock of size %lu\n", cmpctblock.header.GetHash().ToString(), GetSerializeSize(cmpctblock, SER_NETWORK, PROTOCOL_VERSION)); @@ -250,10 +251,10 @@ return READ_STATUS_CHECKBLOCK_FAILED; } - LogPrint(BCLog::CMPCTBLOCK, "Successfully reconstructed block %s with %lu " - "txn prefilled, %lu txn from mempool (incl at " - "least %lu from extra pool) and %lu txn " - "requested\n", + LogPrint(BCLog::CMPCTBLOCK, + "Successfully reconstructed block %s with %lu txn prefilled, %lu " + "txn from mempool (incl at least %lu from extra pool) and %lu txn " + "requested\n", hash.ToString(), prefilled_count, mempool_count, extra_count, vtx_missing.size()); if (vtx_missing.size() < 5) { diff --git a/src/chain.cpp b/src/chain.cpp --- a/src/chain.cpp +++ b/src/chain.cpp @@ -104,9 +104,9 @@ int heightSkip = GetSkipHeight(heightWalk); int heightSkipPrev = GetSkipHeight(heightWalk - 1); if (pindexWalk->pskip != nullptr && - (heightSkip == height || (heightSkip > height && - !(heightSkipPrev < heightSkip - 2 && - heightSkipPrev >= height)))) { + (heightSkip == height || + (heightSkip > height && !(heightSkipPrev < heightSkip - 2 && + heightSkipPrev >= height)))) { // Only follow pskip if pprev->pskip isn't better than pskip->pprev. pindexWalk = pindexWalk->pskip; heightWalk = heightSkip; diff --git a/src/checkqueue.h b/src/checkqueue.h --- a/src/checkqueue.h +++ b/src/checkqueue.h @@ -107,8 +107,8 @@ // helping. // * Don't do batches smaller than 1 (duh), or larger than // nBatchSize. - nNow = std::max(1U, std::min(nBatchSize, - (unsigned int)queue.size() / + nNow = std::max( + 1U, std::min(nBatchSize, (unsigned int)queue.size() / (nTotal + nIdle + 1))); vChecks.resize(nNow); for (unsigned int i = 0; i < nNow; i++) { diff --git a/src/consensus/tx_verify.cpp b/src/consensus/tx_verify.cpp --- a/src/consensus/tx_verify.cpp +++ b/src/consensus/tx_verify.cpp @@ -310,10 +310,10 @@ } if (nValueIn < tx.GetValueOut()) { - return state.DoS(100, false, REJECT_INVALID, "bad-txns-in-belowout", - false, strprintf("value in (%s) < value out (%s)", - FormatMoney(nValueIn), - FormatMoney(tx.GetValueOut()))); + return state.DoS( + 100, false, REJECT_INVALID, "bad-txns-in-belowout", false, + strprintf("value in (%s) < value out (%s)", FormatMoney(nValueIn), + FormatMoney(tx.GetValueOut()))); } // Tally transaction fees diff --git a/src/crypto/ctaes/ctaes.h b/src/crypto/ctaes/ctaes.h --- a/src/crypto/ctaes/ctaes.h +++ b/src/crypto/ctaes/ctaes.h @@ -10,13 +10,21 @@ #include #include -typedef struct { uint16_t slice[8]; } AES_state; +typedef struct { + uint16_t slice[8]; +} AES_state; -typedef struct { AES_state rk[11]; } AES128_ctx; +typedef struct { + AES_state rk[11]; +} AES128_ctx; -typedef struct { AES_state rk[13]; } AES192_ctx; +typedef struct { + AES_state rk[13]; +} AES192_ctx; -typedef struct { AES_state rk[15]; } AES256_ctx; +typedef struct { + AES_state rk[15]; +} AES256_ctx; void AES128_init(AES128_ctx *ctx, const uint8_t *key16); void AES128_encrypt(const AES128_ctx *ctx, size_t blocks, uint8_t *cipher16, diff --git a/src/httpserver.cpp b/src/httpserver.cpp --- a/src/httpserver.cpp +++ b/src/httpserver.cpp @@ -417,16 +417,15 @@ evhttp_set_timeout( http, gArgs.GetArg("-rpcservertimeout", DEFAULT_HTTP_SERVER_TIMEOUT)); evhttp_set_max_headers_size(http, MAX_HEADERS_SIZE); - evhttp_set_max_body_size( - http, MIN_SUPPORTED_BODY_SIZE + 2 * config.GetMaxBlockSize()); + evhttp_set_max_body_size(http, MIN_SUPPORTED_BODY_SIZE + + 2 * config.GetMaxBlockSize()); evhttp_set_gencb(http, http_request_cb, &config); // Only POST and OPTIONS are supported, but we return HTTP 405 for the // others - evhttp_set_allowed_methods(http, - EVHTTP_REQ_GET | EVHTTP_REQ_POST | - EVHTTP_REQ_HEAD | EVHTTP_REQ_PUT | - EVHTTP_REQ_DELETE | EVHTTP_REQ_OPTIONS); + evhttp_set_allowed_methods( + http, EVHTTP_REQ_GET | EVHTTP_REQ_POST | EVHTTP_REQ_HEAD | + EVHTTP_REQ_PUT | EVHTTP_REQ_DELETE | EVHTTP_REQ_OPTIONS); if (!HTTPBindAddresses(http)) { LogPrintf("Unable to bind any endpoint for RPC server\n"); @@ -604,10 +603,10 @@ struct evbuffer *evb = evhttp_request_get_output_buffer(req); assert(evb); evbuffer_add(evb, strReply.data(), strReply.size()); - HTTPEvent *ev = - new HTTPEvent(eventBase, true, std::bind(evhttp_send_reply, req, - nStatus, (const char *)nullptr, - (struct evbuffer *)nullptr)); + HTTPEvent *ev = new HTTPEvent(eventBase, true, + std::bind(evhttp_send_reply, req, nStatus, + (const char *)nullptr, + (struct evbuffer *)nullptr)); ev->trigger(nullptr); replySent = true; // transferred back to main thread. diff --git a/src/init.cpp b/src/init.cpp --- a/src/init.cpp +++ b/src/init.cpp @@ -493,9 +493,8 @@ _("Discover own IP addresses (default: 1 when " "listening and no -externalip or -proxy)")); strUsage += HelpMessageOpt( - "-dns", - _("Allow DNS lookups for -addnode, -seednode and -connect") + " " + - strprintf(_("(default: %d)"), DEFAULT_NAME_LOOKUP)); + "-dns", _("Allow DNS lookups for -addnode, -seednode and -connect") + + " " + strprintf(_("(default: %d)"), DEFAULT_NAME_LOOKUP)); strUsage += HelpMessageOpt( "-dnsseed", _("Query for peer addresses via DNS lookup, if low on " "addresses (default: 1 unless -connect/-noconnect)")); @@ -595,9 +594,10 @@ _("Whitelist peers connecting from the given IP address (e.g. 1.2.3.4) " "or CIDR notated network (e.g. 1.2.3.0/24). Can be specified " "multiple times.") + - " " + _("Whitelisted peers cannot be DoS banned and their " - "transactions are always relayed, even if they are already " - "in the mempool, useful e.g. for a gateway")); + " " + + _("Whitelisted peers cannot be DoS banned and their transactions " + "are always relayed, even if they are already in the mempool, " + "useful e.g. for a gateway")); strUsage += HelpMessageOpt( "-whitelistrelay", strprintf(_("Accept relayed transactions received from whitelisted " @@ -712,8 +712,9 @@ strprintf(_("Output debugging information (default: %u, supplying " " is optional)"), 0) + - ". " + _("If is not supplied or if = 1, " - "output all debugging information.") + + ". " + + _("If is not supplied or if = 1, output all " + "debugging information.") + _(" can be:") + " " + ListLogCategories() + "."); strUsage += HelpMessageOpt( "-debugexclude=", @@ -927,8 +928,9 @@ strprintf(_("Please contribute if you find %s useful. " "Visit %s for further information about the software."), PACKAGE_NAME, URL_WEBSITE) + - "\n" + strprintf(_("The source code is available from %s."), - URL_SOURCE_CODE) + + "\n" + + strprintf(_("The source code is available from %s."), + URL_SOURCE_CODE) + "\n" + "\n" + _("This is experimental software.") + "\n" + strprintf(_("Distributed under the MIT software license, see the " "accompanying file %s or %s"), @@ -2131,9 +2133,8 @@ LOCK(cs_main); CBlockIndex *tip = chainActive.Tip(); RPCNotifyBlockChange(true, tip); - if (tip && - tip->nTime > - GetAdjustedTime() + MAX_FUTURE_BLOCK_TIME) { + if (tip && tip->nTime > GetAdjustedTime() + + MAX_FUTURE_BLOCK_TIME) { strLoadError = _("The block database contains a block which " "appears to be from the future. This may be " diff --git a/src/miner.cpp b/src/miner.cpp --- a/src/miner.cpp +++ b/src/miner.cpp @@ -236,11 +236,12 @@ } int64_t nTime2 = GetTimeMicros(); - LogPrint( - BCLog::BENCH, "CreateNewBlock() packages: %.2fms (%d packages, %d " - "updated descendants), validity: %.2fms (total %.2fms)\n", - 0.001 * (nTime1 - nTimeStart), nPackagesSelected, nDescendantsUpdated, - 0.001 * (nTime2 - nTime1), 0.001 * (nTime2 - nTimeStart)); + LogPrint(BCLog::BENCH, + "CreateNewBlock() packages: %.2fms (%d packages, %d updated " + "descendants), validity: %.2fms (total %.2fms)\n", + 0.001 * (nTime1 - nTimeStart), nPackagesSelected, + nDescendantsUpdated, 0.001 * (nTime2 - nTime1), + 0.001 * (nTime2 - nTimeStart)); return std::move(pblocktemplate); } @@ -437,7 +438,7 @@ * children come after parents, despite having a potentially larger fee. * @param[out] nPackagesSelected How many packages were selected * @param[out] nDescendantsUpdated Number of descendant transactions updated -*/ + */ void BlockAssembler::addPackageTxs(int &nPackagesSelected, int &nDescendantsUpdated) { diff --git a/src/net.cpp b/src/net.cpp --- a/src/net.cpp +++ b/src/net.cpp @@ -1507,8 +1507,9 @@ int64_t nTime = GetSystemTimeInSeconds(); if (nTime - pnode->nTimeConnected > 60) { if (pnode->nLastRecv == 0 || pnode->nLastSend == 0) { - LogPrint(BCLog::NET, "socket no message in first 60 " - "seconds, %d %d from %d\n", + LogPrint(BCLog::NET, + "socket no message in first 60 seconds, %d %d " + "from %d\n", pnode->nLastRecv != 0, pnode->nLastSend != 0, pnode->GetId()); pnode->fDisconnect = true; diff --git a/src/net_processing.cpp b/src/net_processing.cpp --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -326,8 +326,9 @@ nNodeStartingHeight, ::fRelayTxes)); if (fLogIPs) { - LogPrint(BCLog::NET, "send version message: version %d, blocks=%d, " - "us=%s, them=%s, peer=%d\n", + LogPrint(BCLog::NET, + "send version message: version %d, blocks=%d, us=%s, them=%s, " + "peer=%d\n", PROTOCOL_VERSION, nNodeStartingHeight, addrMe.ToString(), addrYou.ToString(), nodeid); } else { @@ -515,11 +516,10 @@ lNodesAnnouncingHeaderAndIDs.pop_front(); } fAnnounceUsingCMPCTBLOCK = true; - connman->PushMessage(pfrom, - CNetMsgMaker(pfrom->GetSendVersion()) - .Make(NetMsgType::SENDCMPCT, - fAnnounceUsingCMPCTBLOCK, - nCMPCTBLOCKVersion)); + connman->PushMessage(pfrom, CNetMsgMaker(pfrom->GetSendVersion()) + .Make(NetMsgType::SENDCMPCT, + fAnnounceUsingCMPCTBLOCK, + nCMPCTBLOCKVersion)); lNodesAnnouncingHeaderAndIDs.push_back(pfrom->GetId()); return true; }); @@ -1296,8 +1296,9 @@ HISTORICAL_BLOCK_AGE)) || inv.type == MSG_FILTERED_BLOCK) && !pfrom->fWhitelisted) { - LogPrint(BCLog::NET, "historical block serving limit " - "reached, disconnect peer=%d\n", + LogPrint(BCLog::NET, + "historical block serving limit reached, " + "disconnect peer=%d\n", pfrom->GetId()); // disconnect node @@ -1329,9 +1330,8 @@ } if (sendMerkleBlock) { connman->PushMessage( - pfrom, - msgMaker.Make(NetMsgType::MERKLEBLOCK, - merkleBlock)); + pfrom, msgMaker.Make(NetMsgType::MERKLEBLOCK, + merkleBlock)); // CMerkleBlock just contains hashes, so also push // any transactions in the block the client did not // see. This avoids hurting performance by @@ -1365,15 +1365,13 @@ chainActive.Height() - MAX_CMPCTBLOCK_DEPTH) { CBlockHeaderAndShortTxIDs cmpctblock(block); connman->PushMessage( - pfrom, - msgMaker.Make(nSendFlags, - NetMsgType::CMPCTBLOCK, - cmpctblock)); + pfrom, msgMaker.Make(nSendFlags, + NetMsgType::CMPCTBLOCK, + cmpctblock)); } else { connman->PushMessage( - pfrom, - msgMaker.Make(nSendFlags, NetMsgType::BLOCK, - block)); + pfrom, msgMaker.Make(nSendFlags, + NetMsgType::BLOCK, block)); } } @@ -1408,10 +1406,9 @@ // a MEMPOOL request. if (txinfo.tx && txinfo.nTime <= pfrom->timeLastMempoolReq) { - connman->PushMessage(pfrom, - msgMaker.Make(nSendFlags, - NetMsgType::TX, - *txinfo.tx)); + connman->PushMessage( + pfrom, msgMaker.Make(nSendFlags, NetMsgType::TX, + *txinfo.tx)); push = true; } } @@ -1500,17 +1497,16 @@ nCount < MAX_BLOCKS_TO_ANNOUNCE) { nodestate->nUnconnectingHeaders++; connman->PushMessage( - pfrom, - msgMaker.Make(NetMsgType::GETHEADERS, - chainActive.GetLocator(pindexBestHeader), - uint256())); - LogPrint(BCLog::NET, "received header %s: missing prev block %s, " - "sending getheaders (%d) to end (peer=%d, " - "nUnconnectingHeaders=%d)\n", - headers[0].GetHash().ToString(), - headers[0].hashPrevBlock.ToString(), - pindexBestHeader->nHeight, pfrom->GetId(), - nodestate->nUnconnectingHeaders); + pfrom, msgMaker.Make(NetMsgType::GETHEADERS, + chainActive.GetLocator(pindexBestHeader), + uint256())); + LogPrint( + BCLog::NET, + "received header %s: missing prev block %s, sending getheaders " + "(%d) to end (peer=%d, nUnconnectingHeaders=%d)\n", + headers[0].GetHash().ToString(), + headers[0].hashPrevBlock.ToString(), pindexBestHeader->nHeight, + pfrom->GetId(), nodestate->nUnconnectingHeaders); // Set hashLastUnknownBlock for this peer, so that if we eventually // get the headers - even from a different peer - we can use this // peer to download. @@ -1671,8 +1667,9 @@ pindex->GetBlockHash().ToString(), pfrom->GetId()); } if (vGetData.size() > 1) { - LogPrint(BCLog::NET, "Downloading blocks toward %s " - "(%d) via headers direct fetch\n", + LogPrint(BCLog::NET, + "Downloading blocks toward %s (%d) via headers " + "direct fetch\n", pindexLast->GetBlockHash().ToString(), pindexLast->nHeight); } @@ -1823,10 +1820,11 @@ if (!pfrom->fInbound && !pfrom->fFeeler && !pfrom->m_manual_connection && !HasAllDesirableServiceFlags(nServices)) { - LogPrint( - BCLog::NET, "peer=%d does not offer the expected services " - "(%08x offered, %08x expected); disconnecting\n", - pfrom->GetId(), nServices, GetDesirableServiceFlags(nServices)); + LogPrint(BCLog::NET, + "peer=%d does not offer the expected services " + "(%08x offered, %08x expected); disconnecting\n", + pfrom->GetId(), nServices, + GetDesirableServiceFlags(nServices)); connman->PushMessage( pfrom, CNetMsgMaker(INIT_PROTO_VERSION) @@ -2014,10 +2012,9 @@ // as well, because they may wish to request compact blocks from us. bool fAnnounceUsingCMPCTBLOCK = false; uint64_t nCMPCTBLOCKVersion = 1; - connman->PushMessage(pfrom, - msgMaker.Make(NetMsgType::SENDCMPCT, - fAnnounceUsingCMPCTBLOCK, - nCMPCTBLOCKVersion)); + connman->PushMessage(pfrom, msgMaker.Make(NetMsgType::SENDCMPCT, + fAnnounceUsingCMPCTBLOCK, + nCMPCTBLOCKVersion)); } pfrom->fSuccessfullyConnected = true; } @@ -2164,8 +2161,9 @@ } else { pfrom->AddInventoryKnown(inv); if (fBlocksOnly) { - LogPrint(BCLog::NET, "transaction (%s) inv sent in " - "violation of protocol peer=%d\n", + LogPrint(BCLog::NET, + "transaction (%s) inv sent in violation of " + "protocol peer=%d\n", inv.hash.ToString(), pfrom->GetId()); } else if (!fAlreadyHave && !fImporting && !fReindex && !IsInitialBlockDownload()) { @@ -2334,8 +2332,9 @@ LOCK(cs_main); if (IsInitialBlockDownload() && !pfrom->fWhitelisted) { - LogPrint(BCLog::NET, "Ignoring getheaders from peer=%d because " - "node is in initial block download\n", + LogPrint(BCLog::NET, + "Ignoring getheaders from peer=%d because node is in " + "initial block download\n", pfrom->GetId()); return true; } @@ -2436,8 +2435,9 @@ pfrom->nLastTXTime = GetTime(); - LogPrint(BCLog::MEMPOOL, "AcceptToMemoryPool: peer=%d: accepted %s " - "(poolsz %u txn, %u kB)\n", + LogPrint(BCLog::MEMPOOL, + "AcceptToMemoryPool: peer=%d: accepted %s " + "(poolsz %u txn, %u kB)\n", pfrom->GetId(), tx.GetId().ToString(), g_mempool.size(), g_mempool.DynamicMemoryUsage() / 1000); @@ -2532,9 +2532,8 @@ // DoS prevention: do not allow mapOrphanTransactions to grow // unbounded unsigned int nMaxOrphanTx = (unsigned int)std::max( - int64_t(0), - gArgs.GetArg("-maxorphantx", - DEFAULT_MAX_ORPHAN_TRANSACTIONS)); + int64_t(0), gArgs.GetArg("-maxorphantx", + DEFAULT_MAX_ORPHAN_TRANSACTIONS)); unsigned int nEvicted = LimitOrphanTxSize(nMaxOrphanTx); if (nEvicted > 0) { LogPrint(BCLog::MEMPOOL, @@ -2596,12 +2595,11 @@ if (state.GetRejectCode() > 0 && state.GetRejectCode() < REJECT_INTERNAL) { connman->PushMessage( - pfrom, - msgMaker.Make(NetMsgType::REJECT, strCommand, - uint8_t(state.GetRejectCode()), - state.GetRejectReason().substr( - 0, MAX_REJECT_MESSAGE_LENGTH), - inv.hash)); + pfrom, msgMaker.Make(NetMsgType::REJECT, strCommand, + uint8_t(state.GetRejectCode()), + state.GetRejectReason().substr( + 0, MAX_REJECT_MESSAGE_LENGTH), + inv.hash)); } if (nDoS > 0) { Misbehaving(pfrom, nDoS, state.GetRejectReason()); @@ -2724,9 +2722,8 @@ // We want to be a bit conservative just to be extra careful about // DoS possibilities in compact block processing... if (pindex->nHeight <= chainActive.Height() + 2) { - if ((!fAlreadyInFlight && - nodestate->nBlocksInFlight < - MAX_BLOCKS_IN_TRANSIT_PER_PEER) || + if ((!fAlreadyInFlight && nodestate->nBlocksInFlight < + MAX_BLOCKS_IN_TRANSIT_PER_PEER) || (fAlreadyInFlight && blockInFlightIt->second.first == pfrom->GetId())) { std::list::iterator *queuedBlockIt = nullptr; @@ -3059,16 +3056,18 @@ else if (strCommand == NetMsgType::MEMPOOL) { if (!(pfrom->GetLocalServices() & NODE_BLOOM) && !pfrom->fWhitelisted) { - LogPrint(BCLog::NET, "mempool request with bloom filters disabled, " - "disconnect peer=%d\n", + LogPrint(BCLog::NET, + "mempool request with bloom filters disabled, disconnect " + "peer=%d\n", pfrom->GetId()); pfrom->fDisconnect = true; return true; } if (connman->OutboundTargetReached(false) && !pfrom->fWhitelisted) { - LogPrint(BCLog::NET, "mempool request with bandwidth limit " - "reached, disconnect peer=%d\n", + LogPrint(BCLog::NET, + "mempool request with bandwidth limit reached, disconnect " + "peer=%d\n", pfrom->GetId()); pfrom->fDisconnect = true; return true; @@ -3241,11 +3240,10 @@ for (const CBlockReject &reject : state.rejects) { connman->PushMessage( - pnode, - CNetMsgMaker(INIT_PROTO_VERSION) - .Make(NetMsgType::REJECT, std::string(NetMsgType::BLOCK), - reject.chRejectCode, reject.strRejectReason, - reject.hashBlock)); + pnode, CNetMsgMaker(INIT_PROTO_VERSION) + .Make(NetMsgType::REJECT, std::string(NetMsgType::BLOCK), + reject.chRejectCode, reject.strRejectReason, + reject.hashBlock)); } state.rejects.clear(); @@ -3373,11 +3371,10 @@ fMoreWork = true; } } catch (const std::ios_base::failure &e) { - connman->PushMessage(pfrom, - CNetMsgMaker(INIT_PROTO_VERSION) - .Make(NetMsgType::REJECT, strCommand, - REJECT_MALFORMED, - std::string("error parsing message"))); + connman->PushMessage( + pfrom, CNetMsgMaker(INIT_PROTO_VERSION) + .Make(NetMsgType::REJECT, strCommand, REJECT_MALFORMED, + std::string("error parsing message"))); if (strstr(e.what(), "end of data")) { // Allow exceptions from under-length message on vRecv LogPrintf( @@ -3465,9 +3462,10 @@ pto->fDisconnect = true; } else { LogPrint( - BCLog::NET, "sending getheaders to outbound peer=%d to " - "verify chain work (current best known " - "block:%s, benchmark blockhash: %s)\n", + BCLog::NET, + "sending getheaders to outbound peer=%d to verify chain " + "work (current best known block:%s, benchmark blockhash: " + "%s)\n", pto->GetId(), state.pindexBestKnownBlock != nullptr ? state.pindexBestKnownBlock->GetBlockHash().ToString() @@ -3549,14 +3547,16 @@ CNodeState &state = *State(pnode->GetId()); if (time_in_seconds - pnode->nTimeConnected > MINIMUM_CONNECT_TIME && state.nBlocksInFlight == 0) { - LogPrint(BCLog::NET, "disconnecting extra outbound peer=%d (last " - "block announcement received at time %d)\n", + LogPrint(BCLog::NET, + "disconnecting extra outbound peer=%d (last block " + "announcement received at time %d)\n", pnode->GetId(), oldest_block_announcement); pnode->fDisconnect = true; return true; } else { - LogPrint(BCLog::NET, "keeping outbound peer=%d chosen for eviction " - "(connect time: %d, blocks_in_flight: %d)\n", + LogPrint(BCLog::NET, + "keeping outbound peer=%d chosen for eviction " + "(connect time: %d, blocks_in_flight: %d)\n", pnode->GetId(), pnode->nTimeConnected, state.nBlocksInFlight); return false; @@ -3864,10 +3864,9 @@ bool ret = ReadBlockFromDisk(block, pBestIndex, config); assert(ret); CBlockHeaderAndShortTxIDs cmpctblock(block); - connman->PushMessage(pto, - msgMaker.Make(nSendFlags, - NetMsgType::CMPCTBLOCK, - cmpctblock)); + connman->PushMessage( + pto, msgMaker.Make(nSendFlags, NetMsgType::CMPCTBLOCK, + cmpctblock)); } state.pindexBestHeaderSent = pBestIndex; } else if (state.fPreferHeaders) { @@ -4221,9 +4220,8 @@ // -whitelistforcerelay if (pto->nVersion >= FEEFILTER_VERSION && gArgs.GetBoolArg("-feefilter", DEFAULT_FEEFILTER) && - !(pto->fWhitelisted && - gArgs.GetBoolArg("-whitelistforcerelay", - DEFAULT_WHITELISTFORCERELAY))) { + !(pto->fWhitelisted && gArgs.GetBoolArg("-whitelistforcerelay", + DEFAULT_WHITELISTFORCERELAY))) { Amount currentFilter = g_mempool .GetMinFee( diff --git a/src/policy/fees.cpp b/src/policy/fees.cpp --- a/src/policy/fees.cpp +++ b/src/policy/fees.cpp @@ -178,14 +178,14 @@ } } - LogPrint(BCLog::ESTIMATEFEE, "%3d: For conf success %s %4.2f need feerate " - "%s: %12.5g from buckets %8g - %8g Cur " - "Bucket stats %6.2f%% %8.1f/(%.1f+%d " - "mempool)\n", - confTarget, requireGreater ? ">" : "<", successBreakPoint, - requireGreater ? ">" : "<", median, buckets[minBucket], - buckets[maxBucket], 100 * nConf / (totalNum + extraNum), nConf, - totalNum, extraNum); + LogPrint( + BCLog::ESTIMATEFEE, + "%3d: For conf success %s %4.2f need feerate %s: %12.5g from buckets " + "%8g - %8g Cur Bucket stats %6.2f%% %8.1f/(%.1f+%d mempool)\n", + confTarget, requireGreater ? ">" : "<", successBreakPoint, + requireGreater ? ">" : "<", median, buckets[minBucket], + buckets[maxBucket], 100 * nConf / (totalNum + extraNum), nConf, + totalNum, extraNum); return CFeeRate(int64_t(ceill(median)) * SATOSHI); } @@ -306,9 +306,9 @@ if (oldUnconfTxs[bucketindex] > 0) { oldUnconfTxs[bucketindex]--; } else { - LogPrint(BCLog::ESTIMATEFEE, "Blockpolicy error, mempool tx " - "removed from >25 " - "blocks,bucketIndex=%u already\n", + LogPrint(BCLog::ESTIMATEFEE, + "Blockpolicy error, mempool tx removed from >25 blocks, " + "bucketIndex=%u already\n", bucketindex); } } else { @@ -447,9 +447,9 @@ // Update all exponential averages with the current block state feeStats.UpdateMovingAverages(); - LogPrint(BCLog::ESTIMATEFEE, "Blockpolicy after updating estimates for %u " - "of %u txs in block, since last block %u of " - "%u tracked, new mempool map size %u\n", + LogPrint(BCLog::ESTIMATEFEE, + "Blockpolicy after updating estimates for %u of %u txs in block, " + "since last block %u of %u tracked, new mempool map size %u\n", countedTxs, entries.size(), trackedTxs, trackedTxs + untrackedTxs, mapMemPoolTxs.size()); diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -417,8 +417,9 @@ // temporary (eg it lives somewhere aside from the stack) or this will // crash because initialize() gets executed in another thread at some // unspecified time (after) requestedInitialize() is emitted! - connect(this, SIGNAL(requestedInitialize( - Config *, HTTPRPCRequestProcessor *, RPCServer *)), + connect(this, + SIGNAL(requestedInitialize(Config *, HTTPRPCRequestProcessor *, + RPCServer *)), executor, SLOT(initialize(Config *, HTTPRPCRequestProcessor *))); connect(this, SIGNAL(requestedShutdown()), executor, SLOT(shutdown())); diff --git a/src/qt/bitcoinamountfield.cpp b/src/qt/bitcoinamountfield.cpp --- a/src/qt/bitcoinamountfield.cpp +++ b/src/qt/bitcoinamountfield.cpp @@ -99,18 +99,18 @@ QSize hint(w, h); QSize extra(35, 6); opt.rect.setSize(hint + extra); - extra += hint - - style() - ->subControlRect(QStyle::CC_SpinBox, &opt, - QStyle::SC_SpinBoxEditField, this) - .size(); + extra += + hint - style() + ->subControlRect(QStyle::CC_SpinBox, &opt, + QStyle::SC_SpinBoxEditField, this) + .size(); // Get closer to final result by repeating the calculation. opt.rect.setSize(hint + extra); - extra += hint - - style() - ->subControlRect(QStyle::CC_SpinBox, &opt, - QStyle::SC_SpinBoxEditField, this) - .size(); + extra += + hint - style() + ->subControlRect(QStyle::CC_SpinBox, &opt, + QStyle::SC_SpinBoxEditField, this) + .size(); hint += extra; hint.setHeight(h); diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -68,7 +68,7 @@ * Set the wallet model. * The wallet model represents a bitcoin wallet, and offers access to the * list of transactions, address book and sending functionality. - */ + */ bool addWallet(WalletModel *walletModel); void removeAllWallets(); #endif // ENABLE_WALLET @@ -189,7 +189,7 @@ #ifdef ENABLE_WALLET bool setCurrentWallet(const QString &name); /** Set the UI status indicators based on the currently selected wallet. - */ + */ void updateWalletStatus(); private: diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp --- a/src/qt/coincontroldialog.cpp +++ b/src/qt/coincontroldialog.cpp @@ -529,10 +529,11 @@ if (nQuantity > 0) { // Bytes // always assume +1 output for change here - nBytes = nBytesInputs + ((CoinControlDialog::payAmounts.size() > 0 - ? CoinControlDialog::payAmounts.size() + 1 - : 2) * - 34) + + nBytes = nBytesInputs + + ((CoinControlDialog::payAmounts.size() > 0 + ? CoinControlDialog::payAmounts.size() + 1 + : 2) * + 34) + 10; // in the subtract fee from amount case, we can tell if zero change @@ -747,10 +748,9 @@ // label if (!(sAddress == sWalletAddress)) { // change tooltip from where the change comes from - itemOutput->setToolTip(COLUMN_LABEL, - tr("change from %1 (%2)") - .arg(sWalletLabel) - .arg(sWalletAddress)); + itemOutput->setToolTip(COLUMN_LABEL, tr("change from %1 (%2)") + .arg(sWalletLabel) + .arg(sWalletAddress)); itemOutput->setText(COLUMN_LABEL, tr("(change)")); } else if (!treeMode) { QString sLabel = diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp --- a/src/qt/overviewpage.cpp +++ b/src/qt/overviewpage.cpp @@ -256,10 +256,12 @@ model->getImmatureBalance(), model->getWatchBalance(), model->getWatchUnconfirmedBalance(), model->getWatchImmatureBalance()); - connect(model, SIGNAL(balanceChanged(Amount, Amount, Amount, Amount, - Amount, Amount)), - this, SLOT(setBalance(Amount, Amount, Amount, Amount, Amount, - Amount))); + connect( + model, + SIGNAL( + balanceChanged(Amount, Amount, Amount, Amount, Amount, Amount)), + this, + SLOT(setBalance(Amount, Amount, Amount, Amount, Amount, Amount))); connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit())); diff --git a/src/qt/platformstyle.cpp b/src/qt/platformstyle.cpp --- a/src/qt/platformstyle.cpp +++ b/src/qt/platformstyle.cpp @@ -36,8 +36,9 @@ for (int x = img.width(); x--;) { for (int y = img.height(); y--;) { const QRgb rgb = img.pixel(x, y); - img.setPixel(x, y, qRgba(colorbase.red(), colorbase.green(), - colorbase.blue(), qAlpha(rgb))); + img.setPixel(x, y, + qRgba(colorbase.red(), colorbase.green(), + colorbase.blue(), qAlpha(rgb))); } } } diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -716,11 +716,12 @@ // peer table signal handling - update peer details when selecting new // node - connect(ui->peerWidget->selectionModel(), - SIGNAL(selectionChanged(const QItemSelection &, - const QItemSelection &)), - this, SLOT(peerSelected(const QItemSelection &, - const QItemSelection &))); + connect( + ui->peerWidget->selectionModel(), + SIGNAL(selectionChanged(const QItemSelection &, + const QItemSelection &)), + this, + SLOT(peerSelected(const QItemSelection &, const QItemSelection &))); // peer table signal handling - update peer details when new nodes are // added to the model connect(model->getPeerTableModel(), SIGNAL(layoutChanged()), this, @@ -1247,9 +1248,8 @@ peerAddrDetails += tr("(node id: %1)").arg(QString::number(stats->nodeStats.nodeid)); if (!stats->nodeStats.addrLocal.empty()) { - peerAddrDetails += "
" + - tr("via %1").arg(QString::fromStdString( - stats->nodeStats.addrLocal)); + peerAddrDetails += "
" + tr("via %1").arg(QString::fromStdString( + stats->nodeStats.addrLocal)); } ui->peerHeading->setText(peerAddrDetails); ui->peerServices->setText( diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -172,10 +172,12 @@ _model->getImmatureBalance(), _model->getWatchBalance(), _model->getWatchUnconfirmedBalance(), _model->getWatchImmatureBalance()); - connect(_model, SIGNAL(balanceChanged(Amount, Amount, Amount, Amount, - Amount, Amount)), - this, SLOT(setBalance(Amount, Amount, Amount, Amount, Amount, - Amount))); + connect( + _model, + SIGNAL( + balanceChanged(Amount, Amount, Amount, Amount, Amount, Amount)), + this, + SLOT(setBalance(Amount, Amount, Amount, Amount, Amount, Amount))); connect(_model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit())); updateDisplayUnit(); @@ -371,8 +373,9 @@ // append transaction size questionString.append( - " (" + QString::number( - (double)currentTransaction.getTransactionSize() / 1000) + + " (" + + QString::number((double)currentTransaction.getTransactionSize() / + 1000) + " kB)"); } diff --git a/src/qt/test/uritests.cpp b/src/qt/test/uritests.cpp --- a/src/qt/test/uritests.cpp +++ b/src/qt/test/uritests.cpp @@ -147,11 +147,12 @@ QString("bitcoincash:qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a")); QVERIFY(rv.label == QString()); - QVERIFY(GUIUtil::parseBitcoinURI( - scheme, "bitcoincash://" - "qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a?" - "message=Wikipedia Example Address", - &rv)); + QVERIFY( + GUIUtil::parseBitcoinURI(scheme, + "bitcoincash://" + "qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a?" + "message=Wikipedia Example Address", + &rv)); QVERIFY(rv.address == QString("bitcoincash:qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a")); QVERIFY(rv.label == QString()); diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp --- a/src/qt/transactiondesc.cpp +++ b/src/qt/transactiondesc.cpp @@ -151,8 +151,9 @@ strHTML += "" + tr("Credit") + ": "; if (wtx.IsInMainChain()) { strHTML += BitcoinUnits::formatHtmlWithUnit(unit, nUnmatured) + - " (" + tr("matures in %n more block(s)", "", - wtx.GetBlocksToMaturity()) + + " (" + + tr("matures in %n more block(s)", "", + wtx.GetBlocksToMaturity()) + ")"; } else { strHTML += "(" + tr("not accepted") + ")"; @@ -382,11 +383,11 @@ } strHTML = strHTML + " " + tr("Amount") + "=" + BitcoinUnits::formatHtmlWithUnit(unit, vout.nValue); - strHTML = strHTML + - " IsMine=" + (wallet->IsMine(vout) & ISMINE_SPENDABLE - ? tr("true") - : tr("false")) + - ""; + strHTML = + strHTML + " IsMine=" + + (wallet->IsMine(vout) & ISMINE_SPENDABLE ? tr("true") + : tr("false")) + + ""; strHTML = strHTML + " IsWatchOnly=" + (wallet->IsMine(vout) & ISMINE_WATCH_ONLY ? tr("true") diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp --- a/src/qt/transactionview.cpp +++ b/src/qt/transactionview.cpp @@ -540,10 +540,9 @@ transactionView->selectionModel()->selectedRows(0); if (!selection.isEmpty()) { QDesktopServices::openUrl(QUrl::fromUserInput( - url.replace("%s", - selection.at(0) - .data(TransactionTableModel::TxHashRole) - .toString()))); + url.replace("%s", selection.at(0) + .data(TransactionTableModel::TxHashRole) + .toString()))); } } diff --git a/src/qt/walletview.cpp b/src/qt/walletview.cpp --- a/src/qt/walletview.cpp +++ b/src/qt/walletview.cpp @@ -117,10 +117,12 @@ SLOT(updateWalletStatus())); // Pass through transaction notifications - connect(this, SIGNAL(incomingTransaction(QString, int, Amount, QString, - QString, QString, QString)), - gui, SLOT(incomingTransaction(QString, int, Amount, QString, - QString, QString, QString))); + connect(this, + SIGNAL(incomingTransaction(QString, int, Amount, QString, + QString, QString, QString)), + gui, + SLOT(incomingTransaction(QString, int, Amount, QString, QString, + QString, QString))); // Connect HD enabled state signal connect(this, SIGNAL(hdEnabledStatusChanged()), gui, diff --git a/src/rest.cpp b/src/rest.cpp --- a/src/rest.cpp +++ b/src/rest.cpp @@ -37,7 +37,10 @@ enum RetFormat rf; const char *name; } rf_names[] = { - {RF_UNDEF, ""}, {RF_BINARY, "bin"}, {RF_HEX, "hex"}, {RF_JSON, "json"}, + {RF_UNDEF, ""}, + {RF_BINARY, "bin"}, + {RF_HEX, "hex"}, + {RF_JSON, "json"}, }; struct CCoin { @@ -139,9 +142,9 @@ boost::split(path, param, boost::is_any_of("/")); if (path.size() != 2) { - return RESTERR(req, HTTP_BAD_REQUEST, "No header count specified. Use " - "/rest/headers//" - ".."); + return RESTERR(req, HTTP_BAD_REQUEST, + "No header count specified. Use " + "/rest/headers//.."); } long count = strtol(path[0].c_str(), nullptr, 10); diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -486,9 +486,10 @@ "\nResult: (for verbose = true):\n" "{ (json object)\n" " \"transactionid\" : { (json object)\n" + - EntryDescriptionString() + " }, ...\n" - "}\n" - "\nExamples:\n" + + EntryDescriptionString() + + " }, ...\n" + "}\n" + "\nExamples:\n" + HelpExampleCli("getrawmempool", "true") + HelpExampleRpc("getrawmempool", "true")); } @@ -522,9 +523,10 @@ "\nResult (for verbose=true):\n" "{ (json object)\n" " \"transactionid\" : { (json object)\n" + - EntryDescriptionString() + " }, ...\n" - "}\n" - "\nExamples:\n" + + EntryDescriptionString() + + " }, ...\n" + "}\n" + "\nExamples:\n" + HelpExampleCli("getmempoolancestors", "\"mytxid\"") + HelpExampleRpc("getmempoolancestors", "\"mytxid\"")); } @@ -591,9 +593,10 @@ "\nResult (for verbose=true):\n" "{ (json object)\n" " \"transactionid\" : { (json object)\n" + - EntryDescriptionString() + " }, ...\n" - "}\n" - "\nExamples:\n" + + EntryDescriptionString() + + " }, ...\n" + "}\n" + "\nExamples:\n" + HelpExampleCli("getmempooldescendants", "\"mytxid\"") + HelpExampleRpc("getmempooldescendants", "\"mytxid\"")); } @@ -646,8 +649,9 @@ "The transaction id (must be in mempool)\n" "\nResult:\n" "{ (json object)\n" + - EntryDescriptionString() + "}\n" - "\nExamples:\n" + + EntryDescriptionString() + + "}\n" + "\nExamples:\n" + HelpExampleCli("getmempoolentry", "\"mytxid\"") + HelpExampleRpc("getmempoolentry", "\"mytxid\"")); } diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -662,9 +662,8 @@ result.pushKV("coinbaseaux", aux); result.pushKV("coinbasevalue", int64_t(pblock->vtx[0]->vout[0].nValue / SATOSHI)); - result.pushKV("longpollid", - chainActive.Tip()->GetBlockHash().GetHex() + - i64tostr(nTransactionsUpdatedLast)); + result.pushKV("longpollid", chainActive.Tip()->GetBlockHash().GetHex() + + i64tostr(nTransactionsUpdatedLast)); result.pushKV("target", hashTarget.GetHex()); result.pushKV("mintime", int64_t(pindexPrev->GetMedianTimePast()) + 1); result.pushKV("mutable", aMutable); diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -76,9 +76,10 @@ "unlocked for transfers, or 0 if the wallet is locked\n" " \"paytxfee\": x.xxxx, (numeric) the transaction fee set " "in " + - CURRENCY_UNIT + "/kB\n" - " \"relayfee\": x.xxxx, (numeric) minimum " - "relay fee for non-free transactions in " + + CURRENCY_UNIT + + "/kB\n" + " \"relayfee\": x.xxxx, (numeric) minimum relay fee for " + "non-free transactions in " + CURRENCY_UNIT + "/kB\n" " \"errors\": \"...\" (string) any error messages\n" @@ -116,9 +117,8 @@ obj.pushKV("proxy", (proxy.IsValid() ? proxy.proxy.ToStringIPPort() : std::string())); obj.pushKV("difficulty", double(GetDifficulty(chainActive.Tip()))); - obj.pushKV("testnet", - config.GetChainParams().NetworkIDString() == - CBaseChainParams::TESTNET); + obj.pushKV("testnet", config.GetChainParams().NetworkIDString() == + CBaseChainParams::TESTNET); #ifdef ENABLE_WALLET if (pwallet) { obj.pushKV("keypoololdest", pwallet->GetOldestKeyPoolTime()); @@ -507,8 +507,9 @@ HelpExampleCli("verifymessage", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4" "XX\" \"signature\" \"my " "message\"") + - "\nAs json rpc\n" + HelpExampleRpc("signmessagewithprivkey", - "\"privkey\", \"my message\"")); + "\nAs json rpc\n" + + HelpExampleRpc("signmessagewithprivkey", + "\"privkey\", \"my message\"")); } std::string strPrivkey = request.params[0].get_str(); diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp --- a/src/rpc/net.cpp +++ b/src/rpc/net.cpp @@ -494,9 +494,8 @@ obj.pushKV("name", GetNetworkName(network)); obj.pushKV("limited", IsLimited(network)); obj.pushKV("reachable", IsReachable(network)); - obj.pushKV("proxy", - proxy.IsValid() ? proxy.proxy.ToStringIPPort() - : std::string()); + obj.pushKV("proxy", proxy.IsValid() ? proxy.proxy.ToStringIPPort() + : std::string()); obj.pushKV("proxy_randomize_credentials", proxy.randomize_credentials); networks.push_back(obj); } @@ -550,23 +549,24 @@ "/kB\n" " \"excessutxocharge\": x.xxxxxxxx, (numeric) minimum " "charge for excess utxos in " + - CURRENCY_UNIT + "\n" - " \"localaddresses\": [ " - "(array) list of local addresses\n" - " {\n" - " \"address\": \"xxxx\", " - "(string) network address\n" - " \"port\": xxx, " - "(numeric) network port\n" - " \"score\": xxx " - "(numeric) relative score\n" - " }\n" - " ,...\n" - " ]\n" - " \"warnings\": \"...\" " - "(string) any network warnings\n" - "}\n" - "\nExamples:\n" + + CURRENCY_UNIT + + "\n" + " \"localaddresses\": [ " + "(array) list of local addresses\n" + " {\n" + " \"address\": \"xxxx\", " + "(string) network address\n" + " \"port\": xxx, " + "(numeric) network port\n" + " \"score\": xxx " + "(numeric) relative score\n" + " }\n" + " ,...\n" + " ]\n" + " \"warnings\": \"...\" " + "(string) any network warnings\n" + "}\n" + "\nExamples:\n" + HelpExampleCli("getnetworkinfo", "") + HelpExampleRpc("getnetworkinfo", "")); } diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -1056,13 +1056,12 @@ // signed: if (fGivenKeys && scriptPubKey.IsPayToScriptHash()) { RPCTypeCheckObj( - prevOut, - { - {"txid", UniValueType(UniValue::VSTR)}, - {"vout", UniValueType(UniValue::VNUM)}, - {"scriptPubKey", UniValueType(UniValue::VSTR)}, - {"redeemScript", UniValueType(UniValue::VSTR)}, - }); + prevOut, { + {"txid", UniValueType(UniValue::VSTR)}, + {"vout", UniValueType(UniValue::VNUM)}, + {"scriptPubKey", UniValueType(UniValue::VSTR)}, + {"redeemScript", UniValueType(UniValue::VSTR)}, + }); UniValue v = find_value(prevOut, "redeemScript"); if (!v.isNull()) { std::vector rsData(ParseHexV(v, "redeemScript")); @@ -1150,9 +1149,10 @@ if (serror == SCRIPT_ERR_INVALID_STACK_OPERATION) { // Unable to sign input and verification failed (possible // attempt to partially sign). - TxInErrorToJSON(txin, vErrors, "Unable to sign input, invalid " - "stack size (possibly missing " - "key)"); + TxInErrorToJSON(txin, vErrors, + "Unable to sign input, invalid " + "stack size (possibly missing " + "key)"); } else { TxInErrorToJSON(txin, vErrors, ScriptErrorString(serror)); } diff --git a/src/scheduler.h b/src/scheduler.h --- a/src/scheduler.h +++ b/src/scheduler.h @@ -45,9 +45,8 @@ typedef std::function Predicate; // Call func at/after time t - void schedule(Function f, - boost::chrono::system_clock::time_point t = - boost::chrono::system_clock::now()); + void schedule(Function f, boost::chrono::system_clock::time_point t = + boost::chrono::system_clock::now()); // Convenience method: call f once deltaMilliSeconds from now void scheduleFromNow(Function f, int64_t deltaMilliSeconds); diff --git a/src/scheduler.cpp b/src/scheduler.cpp --- a/src/scheduler.cpp +++ b/src/scheduler.cpp @@ -99,9 +99,8 @@ void CScheduler::scheduleFromNow(CScheduler::Function f, int64_t deltaMilliSeconds) { - schedule(f, - boost::chrono::system_clock::now() + - boost::chrono::milliseconds(deltaMilliSeconds)); + schedule(f, boost::chrono::system_clock::now() + + boost::chrono::milliseconds(deltaMilliSeconds)); } static void Repeat(CScheduler *s, CScheduler::Predicate p, diff --git a/src/script/script.cpp b/src/script/script.cpp --- a/src/script/script.cpp +++ b/src/script/script.cpp @@ -258,11 +258,11 @@ case OP_INVALIDOPCODE: return "OP_INVALIDOPCODE"; - // Note: - // The template matching params OP_SMALLINTEGER/etc are defined in - // opcodetype enum as kind of implementation hack, they are *NOT* - // real opcodes. If found in real Script, just let the default: - // case deal with them. + // Note: + // The template matching params OP_SMALLINTEGER/etc are defined in + // opcodetype enum as kind of implementation hack, they are *NOT* + // real opcodes. If found in real Script, just let the default: + // case deal with them. default: return "OP_UNKNOWN"; diff --git a/src/script/scriptcache.cpp b/src/script/scriptcache.cpp --- a/src/script/scriptcache.cpp +++ b/src/script/scriptcache.cpp @@ -20,10 +20,10 @@ // nMaxCacheSize is unsigned. If -maxscriptcachesize is set to zero, // setup_bytes creates the minimum possible cache (2 elements). size_t nMaxCacheSize = - std::min(std::max(int64_t(0), - gArgs.GetArg("-maxscriptcachesize", - DEFAULT_MAX_SCRIPT_CACHE_SIZE)), - MAX_MAX_SCRIPT_CACHE_SIZE) * + std::min( + std::max(int64_t(0), gArgs.GetArg("-maxscriptcachesize", + DEFAULT_MAX_SCRIPT_CACHE_SIZE)), + MAX_MAX_SCRIPT_CACHE_SIZE) * (size_t(1) << 20); size_t nElems = scriptExecutionCache.setup_bytes(nMaxCacheSize); LogPrintf("Using %zu MiB out of %zu requested for script execution cache, " diff --git a/src/script/sigcache.cpp b/src/script/sigcache.cpp --- a/src/script/sigcache.cpp +++ b/src/script/sigcache.cpp @@ -70,9 +70,8 @@ // nMaxCacheSize is unsigned. If -maxsigcachesize is set to zero, // setup_bytes creates the minimum possible cache (2 elements). size_t nMaxCacheSize = - std::min(std::max(int64_t(0), - gArgs.GetArg("-maxsigcachesize", - DEFAULT_MAX_SIG_CACHE_SIZE)), + std::min(std::max(int64_t(0), gArgs.GetArg("-maxsigcachesize", + DEFAULT_MAX_SIG_CACHE_SIZE)), MAX_MAX_SIG_CACHE_SIZE) * (size_t(1) << 20); size_t nElems = signatureCache.setup_bytes(nMaxCacheSize); diff --git a/src/script/standard.cpp b/src/script/standard.cpp --- a/src/script/standard.cpp +++ b/src/script/standard.cpp @@ -50,16 +50,14 @@ // Bitcoin address tx, sender provides hash of pubkey, receiver provides // signature and pubkey - mTemplates.insert( - std::make_pair(TX_PUBKEYHASH, - CScript() << OP_DUP << OP_HASH160 << OP_PUBKEYHASH + mTemplates.insert(std::make_pair( + TX_PUBKEYHASH, CScript() << OP_DUP << OP_HASH160 << OP_PUBKEYHASH << OP_EQUALVERIFY << OP_CHECKSIG)); // Sender provides N pubkeys, receivers provides M signatures - mTemplates.insert( - std::make_pair(TX_MULTISIG, - CScript() << OP_SMALLINTEGER << OP_PUBKEYS - << OP_SMALLINTEGER << OP_CHECKMULTISIG)); + mTemplates.insert(std::make_pair( + TX_MULTISIG, CScript() << OP_SMALLINTEGER << OP_PUBKEYS + << OP_SMALLINTEGER << OP_CHECKMULTISIG)); } vSolutionsRet.clear(); diff --git a/src/seeder/bitcoin.cpp b/src/seeder/bitcoin.cpp --- a/src/seeder/bitcoin.cpp +++ b/src/seeder/bitcoin.cpp @@ -294,9 +294,9 @@ bool res = true; int64_t now; - while (now = time(nullptr), - ban == 0 && (doneAfter == 0 || doneAfter > now) && - sock != INVALID_SOCKET) { + while (now = time(nullptr), ban == 0 && + (doneAfter == 0 || doneAfter > now) && + sock != INVALID_SOCKET) { char pchBuf[0x10000]; fd_set set; FD_ZERO(&set); diff --git a/src/seeder/dns.cpp b/src/seeder/dns.cpp --- a/src/seeder/dns.cpp +++ b/src/seeder/dns.cpp @@ -563,7 +563,8 @@ uint8_t inbuf[BUFLEN], outbuf[BUFLEN]; struct iovec iov[1] = { { - .iov_base = inbuf, .iov_len = sizeof(inbuf), + .iov_base = inbuf, + .iov_len = sizeof(inbuf), }, }; diff --git a/src/sync.cpp b/src/sync.cpp --- a/src/sync.cpp +++ b/src/sync.cpp @@ -98,8 +98,9 @@ LogPrintf(" %s\n", i.second.ToString()); } if (g_debug_lockorder_abort) { - fprintf(stderr, "Assertion failed: detected inconsistent lock order at " - "%s:%i, details in debug log.\n", + fprintf(stderr, + "Assertion failed: detected inconsistent lock order at %s:%i, " + "details in debug log.\n", __FILE__, __LINE__); abort(); } diff --git a/src/test/cashaddrenc_tests.cpp b/src/test/cashaddrenc_tests.cpp --- a/src/test/cashaddrenc_tests.cpp +++ b/src/test/cashaddrenc_tests.cpp @@ -345,8 +345,9 @@ "C060"), "bitcoincash:" "qvch8mmxy0rtfrlarg7ucrxxfzds5pamg73h7370aa87d80gyhqxq5nlegake"}, - {"bchtest", SCRIPT_TYPE, ParseHex("3173EF6623C6B48FFD1A3DCC0CC6489B0A07" - "BB47A37F47CFEF4FE69DE825C060"), + {"bchtest", SCRIPT_TYPE, + ParseHex("3173EF6623C6B48FFD1A3DCC0CC6489B0A07BB47A37F47CFEF4FE69DE825" + "C060"), "bchtest:" "pvch8mmxy0rtfrlarg7ucrxxfzds5pamg73h7370aa87d80gyhqxq7fqng6m6"}, {"prefix", CashAddrType(15), diff --git a/src/test/crypto_tests.cpp b/src/test/crypto_tests.cpp --- a/src/test/crypto_tests.cpp +++ b/src/test/crypto_tests.cpp @@ -159,9 +159,9 @@ _size = dec.Decrypt(&subout[0], subout.size(), &subdecrypted[0]); subdecrypted.resize(_size); BOOST_CHECK(decrypted.size() == in.size()); - BOOST_CHECK_MESSAGE(subdecrypted == sub, - HexStr(subdecrypted) + std::string(" != ") + - HexStr(sub)); + BOOST_CHECK_MESSAGE(subdecrypted == sub, HexStr(subdecrypted) + + std::string(" != ") + + HexStr(sub)); } } } @@ -204,9 +204,9 @@ _size = dec.Decrypt(&subout[0], subout.size(), &subdecrypted[0]); subdecrypted.resize(_size); BOOST_CHECK(decrypted.size() == in.size()); - BOOST_CHECK_MESSAGE(subdecrypted == sub, - HexStr(subdecrypted) + std::string(" != ") + - HexStr(sub)); + BOOST_CHECK_MESSAGE(subdecrypted == sub, HexStr(subdecrypted) + + std::string(" != ") + + HexStr(sub)); } } } @@ -568,31 +568,34 @@ // Test vector from RFC 7539 TestChaCha20( "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", - 0x4a000000UL, 1, "224f51f3401bd9e12fde276fb8631ded8c131f823d2c06e27e4fc" - "aec9ef3cf788a3b0aa372600a92b57974cded2b9334794cba40c6" - "3e34cdea212c4cf07d41b769a6749f3f630f4122cafe28ec4dc47" - "e26d4346d70b98c73f3e9c53ac40c5945398b6eda1a832c89c167" - "eacd901d7e2bf363"); + 0x4a000000UL, 1, + "224f51f3401bd9e12fde276fb8631ded8c131f823d2c06e27e4fcaec9ef3cf788a3b0a" + "a372600a92b57974cded2b9334794cba40c63e34cdea212c4cf07d41b769a6749f3f63" + "0f4122cafe28ec4dc47e26d4346d70b98c73f3e9c53ac40c5945398b6eda1a832c89c1" + "67eacd901d7e2bf363"); // Test vectors from // https://tools.ietf.org/html/draft-agl-tls-chacha20poly1305-04#section-7 TestChaCha20( "0000000000000000000000000000000000000000000000000000000000000000", 0, - 0, "76b8e0ada0f13d90405d6ae55386bd28bdd219b8a08ded1aa836efcc8b770dc7da4" - "1597c5157488d7724e03fb8d84a376a43b8f41518a11cc387b669b2ee6586"); + 0, + "76b8e0ada0f13d90405d6ae55386bd28bdd219b8a08ded1aa836efcc8b770dc7da4" + "1597c5157488d7724e03fb8d84a376a43b8f41518a11cc387b669b2ee6586"); TestChaCha20( "0000000000000000000000000000000000000000000000000000000000000001", 0, - 0, "4540f05a9f1fb296d7736e7b208e3c96eb4fe1834688d2604f450952ed432d41bbe" - "2a0b6ea7566d2a5d1e7e20d42af2c53d792b1c43fea817e9ad275ae546963"); + 0, + "4540f05a9f1fb296d7736e7b208e3c96eb4fe1834688d2604f450952ed432d41bbe" + "2a0b6ea7566d2a5d1e7e20d42af2c53d792b1c43fea817e9ad275ae546963"); TestChaCha20( "0000000000000000000000000000000000000000000000000000000000000000", - 0x0100000000000000ULL, 0, "de9cba7bf3d69ef5e786dc63973f653a0b49e015adbf" - "f7134fcb7df137821031e85a050278a7084527214f73" - "efc7fa5b5277062eb7a0433e445f41e3"); + 0x0100000000000000ULL, 0, + "de9cba7bf3d69ef5e786dc63973f653a0b49e015adbff7134fcb7df137821031e85a05" + "0278a7084527214f73efc7fa5b5277062eb7a0433e445f41e3"); TestChaCha20( "0000000000000000000000000000000000000000000000000000000000000000", 1, - 0, "ef3fdfd6c61578fbf5cf35bd3dd33b8009631634d21e42ac33960bd138e50d32111" - "e4caf237ee53ca8ad6426194a88545ddc497a0b466e7d6bbdb0041b2f586b"); + 0, + "ef3fdfd6c61578fbf5cf35bd3dd33b8009631634d21e42ac33960bd138e50d32111" + "e4caf237ee53ca8ad6426194a88545ddc497a0b466e7d6bbdb0041b2f586b"); TestChaCha20( "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", 0x0706050403020100ULL, 0, diff --git a/src/test/miner_tests.cpp b/src/test/miner_tests.cpp --- a/src/test/miner_tests.cpp +++ b/src/test/miner_tests.cpp @@ -100,32 +100,29 @@ // This tx has a low fee: 1000 satoshis. // Save this txid for later use. TxId parentTxId = tx.GetId(); - g_mempool.addUnchecked(parentTxId, - entry.Fee(1000 * SATOSHI) - .Time(GetTime()) - .SpendsCoinbase(true) - .FromTx(tx)); + g_mempool.addUnchecked(parentTxId, entry.Fee(1000 * SATOSHI) + .Time(GetTime()) + .SpendsCoinbase(true) + .FromTx(tx)); // This tx has a medium fee: 10000 satoshis. tx.vin[0].prevout = COutPoint(txFirst[1]->GetId(), 0); tx.vout[0].nValue = int64_t(5000000000LL - 10000) * SATOSHI; TxId mediumFeeTxId = tx.GetId(); - g_mempool.addUnchecked(mediumFeeTxId, - entry.Fee(10000 * SATOSHI) - .Time(GetTime()) - .SpendsCoinbase(true) - .FromTx(tx)); + g_mempool.addUnchecked(mediumFeeTxId, entry.Fee(10000 * SATOSHI) + .Time(GetTime()) + .SpendsCoinbase(true) + .FromTx(tx)); // This tx has a high fee, but depends on the first transaction. tx.vin[0].prevout = COutPoint(parentTxId, 0); // 50k satoshi fee. tx.vout[0].nValue = int64_t(5000000000LL - 1000 - 50000) * SATOSHI; TxId highFeeTxId = tx.GetId(); - g_mempool.addUnchecked(highFeeTxId, - entry.Fee(50000 * SATOSHI) - .Time(GetTime()) - .SpendsCoinbase(false) - .FromTx(tx)); + g_mempool.addUnchecked(highFeeTxId, entry.Fee(50000 * SATOSHI) + .Time(GetTime()) + .SpendsCoinbase(false) + .FromTx(tx)); std::unique_ptr pblocktemplate = BlockAssembler(config, g_mempool).CreateNewBlock(scriptPubKey); @@ -331,11 +328,10 @@ bool spendsCoinbase = (i == 0) ? true : false; // If we don't set the # of sig ops in the CTxMemPoolEntry, template // creation fails. - g_mempool.addUnchecked(hash, - entry.Fee(LOWFEE) - .Time(GetTime()) - .SpendsCoinbase(spendsCoinbase) - .FromTx(tx)); + g_mempool.addUnchecked(hash, entry.Fee(LOWFEE) + .Time(GetTime()) + .SpendsCoinbase(spendsCoinbase) + .FromTx(tx)); tx.vin[0].prevout = COutPoint(hash, 0); } BOOST_CHECK_THROW( @@ -352,12 +348,11 @@ bool spendsCoinbase = (i == 0) ? true : false; // If we do set the # of sig ops in the CTxMemPoolEntry, template // creation passes. - g_mempool.addUnchecked(hash, - entry.Fee(LOWFEE) - .Time(GetTime()) - .SpendsCoinbase(spendsCoinbase) - .SigOpsCost(80) - .FromTx(tx)); + g_mempool.addUnchecked(hash, entry.Fee(LOWFEE) + .Time(GetTime()) + .SpendsCoinbase(spendsCoinbase) + .SigOpsCost(80) + .FromTx(tx)); tx.vin[0].prevout = COutPoint(hash, 0); } BOOST_CHECK( @@ -381,11 +376,10 @@ hash = tx.GetId(); // Only first tx spends coinbase. bool spendsCoinbase = (i == 0) ? true : false; - g_mempool.addUnchecked(hash, - entry.Fee(LOWFEE) - .Time(GetTime()) - .SpendsCoinbase(spendsCoinbase) - .FromTx(tx)); + g_mempool.addUnchecked(hash, entry.Fee(LOWFEE) + .Time(GetTime()) + .SpendsCoinbase(spendsCoinbase) + .FromTx(tx)); tx.vin[0].prevout = COutPoint(hash, 0); } BOOST_CHECK( diff --git a/src/test/policyestimator_tests.cpp b/src/test/policyestimator_tests.cpp --- a/src/test/policyestimator_tests.cpp +++ b/src/test/policyestimator_tests.cpp @@ -59,12 +59,11 @@ // make transaction unique tx.vin[0].nSequence = 10000 * blocknum + 100 * j + k; TxId txid = tx.GetId(); - mpool.addUnchecked(txid, - entry.Fee(feeV[j]) - .Time(GetTime()) - .Priority(0) - .Height(blocknum) - .FromTx(tx, &mpool)); + mpool.addUnchecked(txid, entry.Fee(feeV[j]) + .Time(GetTime()) + .Priority(0) + .Height(blocknum) + .FromTx(tx, &mpool)); txIds[j].push_back(txid); } } @@ -161,12 +160,11 @@ for (int k = 0; k < 4; k++) { tx.vin[0].nSequence = 10000 * blocknum + 100 * j + k; TxId txid = tx.GetId(); - mpool.addUnchecked(txid, - entry.Fee(feeV[j]) - .Time(GetTime()) - .Priority(0) - .Height(blocknum) - .FromTx(tx, &mpool)); + mpool.addUnchecked(txid, entry.Fee(feeV[j]) + .Time(GetTime()) + .Priority(0) + .Height(blocknum) + .FromTx(tx, &mpool)); txIds[j].push_back(txid); } } @@ -211,12 +209,11 @@ for (int k = 0; k < 4; k++) { tx.vin[0].nSequence = 10000 * blocknum + 100 * j + k; TxId txid = tx.GetId(); - mpool.addUnchecked(txid, - entry.Fee(feeV[j]) - .Time(GetTime()) - .Priority(0) - .Height(blocknum) - .FromTx(tx, &mpool)); + mpool.addUnchecked(txid, entry.Fee(feeV[j]) + .Time(GetTime()) + .Priority(0) + .Height(blocknum) + .FromTx(tx, &mpool)); CTransactionRef ptx = mpool.get(txid); if (ptx) { block.push_back(ptx); @@ -278,12 +275,11 @@ tx.vin[0].nSequence = 10000 * blocknum + j; TxId txid = tx.GetId(); mpool.addUnchecked( - txid, - entry.Fee((j + 1) * DEFAULT_BLOCK_MIN_TX_FEE_PER_KB) - .Time(GetTime()) - .Priority(0) - .Height(blocknum) - .FromTx(tx, &mpool)); + txid, entry.Fee((j + 1) * DEFAULT_BLOCK_MIN_TX_FEE_PER_KB) + .Time(GetTime()) + .Priority(0) + .Height(blocknum) + .FromTx(tx, &mpool)); CTransactionRef ptx = mpool.get(txid); block.push_back(ptx); } diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -1325,8 +1325,8 @@ std::string str = JSONPrettyPrint(test.GetJSON()); #ifndef UPDATE_JSON_TESTS if (tests_set.count(str) == 0) { - BOOST_CHECK_MESSAGE( - false, "Missing auto script_valid test: " + test.GetComment()); + BOOST_CHECK_MESSAGE(false, "Missing auto script_valid test: " + + test.GetComment()); } #endif strGen += str + ",\n"; @@ -1694,8 +1694,9 @@ combined.scriptSig == scriptSig); // dummy scriptSigCopy with placeholder, should always choose // non-placeholder: - scriptSigCopy = CScript() << OP_0 << std::vector(pkSingle.begin(), - pkSingle.end()); + scriptSigCopy = CScript() + << OP_0 + << std::vector(pkSingle.begin(), pkSingle.end()); combined = CombineSignatures( scriptPubKey, MutableTransactionSignatureChecker(&txTo, 0, amount), SignatureData(scriptSigCopy), SignatureData(scriptSig)); diff --git a/src/test/sigencoding_tests.cpp b/src/test/sigencoding_tests.cpp --- a/src/test/sigencoding_tests.cpp +++ b/src/test/sigencoding_tests.cpp @@ -63,9 +63,8 @@ CheckTransactionSignatureEncoding(invalidSig, flags, &err), !hasStrictEnc); if (hasStrictEnc) { - BOOST_CHECK_EQUAL(err, - hasForkId ? SCRIPT_ERR_MUST_USE_FORKID - : SCRIPT_ERR_ILLEGAL_FORKID); + BOOST_CHECK_EQUAL(err, hasForkId ? SCRIPT_ERR_MUST_USE_FORKID + : SCRIPT_ERR_ILLEGAL_FORKID); } } } @@ -350,10 +349,9 @@ BOOST_CHECK_EQUAL(CheckPubKeyEncoding(key, flags, &err), allowInvalidKeys); if (!allowInvalidKeys) { - BOOST_CHECK_EQUAL(err, - hasStrictEnc - ? SCRIPT_ERR_PUBKEYTYPE - : SCRIPT_ERR_NONCOMPRESSED_PUBKEY); + BOOST_CHECK_EQUAL(err, hasStrictEnc + ? SCRIPT_ERR_PUBKEYTYPE + : SCRIPT_ERR_NONCOMPRESSED_PUBKEY); } } } diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp --- a/src/test/transaction_tests.cpp +++ b/src/test/transaction_tests.cpp @@ -124,11 +124,12 @@ uint32_t verify_flags = ParseScriptFlags(test[2].get_str()); BOOST_CHECK_MESSAGE( - VerifyScript(tx.vin[i].scriptSig, - mapprevOutScriptPubKeys[tx.vin[i].prevout], - verify_flags, TransactionSignatureChecker( - &tx, i, amount, txdata), - &err), + VerifyScript( + tx.vin[i].scriptSig, + mapprevOutScriptPubKeys[tx.vin[i].prevout], + verify_flags, + TransactionSignatureChecker(&tx, i, amount, txdata), + &err), strTest); BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err)); @@ -584,11 +585,12 @@ CheckWithFlag(output2, input2, 0, false); BOOST_CHECK(*output1 == *output2); UpdateTransaction( - input1, 0, CombineSignatures(output1->vout[0].scriptPubKey, - MutableTransactionSignatureChecker( - &input1, 0, output1->vout[0].nValue), - DataFromTransaction(input1, 0), - DataFromTransaction(input2, 0))); + input1, 0, + CombineSignatures(output1->vout[0].scriptPubKey, + MutableTransactionSignatureChecker( + &input1, 0, output1->vout[0].nValue), + DataFromTransaction(input1, 0), + DataFromTransaction(input2, 0))); CheckWithFlag(output1, input1, STANDARD_SCRIPT_VERIFY_FLAGS, true); // P2SH 2-of-2 multisig @@ -604,11 +606,12 @@ CheckWithFlag(output2, input2, SCRIPT_VERIFY_P2SH, false); BOOST_CHECK(*output1 == *output2); UpdateTransaction( - input1, 0, CombineSignatures(output1->vout[0].scriptPubKey, - MutableTransactionSignatureChecker( - &input1, 0, output1->vout[0].nValue), - DataFromTransaction(input1, 0), - DataFromTransaction(input2, 0))); + input1, 0, + CombineSignatures(output1->vout[0].scriptPubKey, + MutableTransactionSignatureChecker( + &input1, 0, output1->vout[0].nValue), + DataFromTransaction(input1, 0), + DataFromTransaction(input2, 0))); CheckWithFlag(output1, input1, SCRIPT_VERIFY_P2SH, true); CheckWithFlag(output1, input1, STANDARD_SCRIPT_VERIFY_FLAGS, true); } diff --git a/src/timedata.cpp b/src/timedata.cpp --- a/src/timedata.cpp +++ b/src/timedata.cpp @@ -77,9 +77,8 @@ std::vector vSorted = vTimeOffsets.sorted(); // Only let other nodes change our time by so much if (abs64(nMedian) <= - std::max(0, - gArgs.GetArg("-maxtimeadjustment", - DEFAULT_MAX_TIME_ADJUSTMENT))) { + std::max(0, gArgs.GetArg("-maxtimeadjustment", + DEFAULT_MAX_TIME_ADJUSTMENT))) { nTimeOffset = nMedian; } else { nTimeOffset = 0; diff --git a/src/torcontrol.cpp b/src/torcontrol.cpp --- a/src/torcontrol.cpp +++ b/src/torcontrol.cpp @@ -675,8 +675,9 @@ boost::bind(&TorController::auth_cb, this, _1, _2)); } else if (methods.count("SAFECOOKIE")) { // Cookie: hexdump -e '32/1 "%02x""\n"' ~/.tor/control_auth_cookie - LogPrint(BCLog::TOR, "tor: Using SAFECOOKIE authentication, " - "reading cookie authentication from %s\n", + LogPrint(BCLog::TOR, + "tor: Using SAFECOOKIE authentication, " + "reading cookie authentication from %s\n", cookiefile); std::pair status_cookie = ReadBinaryFile(cookiefile, TOR_COOKIE_SIZE); diff --git a/src/txdb.cpp b/src/txdb.cpp --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -141,8 +141,9 @@ LogPrint(BCLog::COINDB, "Writing final batch of %.2f MiB\n", batch.SizeEstimate() * (1.0 / 1048576.0)); bool ret = db.WriteBatch(batch); - LogPrint(BCLog::COINDB, "Committed %u changed transaction outputs (out of " - "%u) to coin database...\n", + LogPrint(BCLog::COINDB, + "Committed %u changed transaction outputs (out of " + "%u) to coin database...\n", (unsigned int)changed, (unsigned int)count); return ret; } diff --git a/src/txmempool.h b/src/txmempool.h --- a/src/txmempool.h +++ b/src/txmempool.h @@ -807,9 +807,8 @@ * transaction that is removed, so we can't remove intermediate transactions * in a chain before we've updated all the state for the removal. */ - void removeUnchecked( - txiter entry, - MemPoolRemovalReason reason = MemPoolRemovalReason::UNKNOWN); + void removeUnchecked(txiter entry, MemPoolRemovalReason reason = + MemPoolRemovalReason::UNKNOWN); }; /** diff --git a/src/validation.cpp b/src/validation.cpp --- a/src/validation.cpp +++ b/src/validation.cpp @@ -1028,8 +1028,9 @@ // should be detected by both). We define it this way because it allows us // to only store the highest fork tip (+ base) which meets the 7-block // condition and from this always have the most-likely-to-cause-warning fork - if (pfork && (!pindexBestForkTip || - pindexNewForkTip->nHeight > pindexBestForkTip->nHeight) && + if (pfork && + (!pindexBestForkTip || + pindexNewForkTip->nHeight > pindexBestForkTip->nHeight) && pindexNewForkTip->nChainWork - pfork->nChainWork > (GetBlockProof(*pfork) * 7) && chainActive.Height() - pindexNewForkTip->nHeight < 72) { @@ -1843,9 +1844,10 @@ Amount blockReward = nFees + GetBlockSubsidy(pindex->nHeight, consensusParams); if (block.vtx[0]->GetValueOut() > blockReward) { - return state.DoS(100, error("ConnectBlock(): coinbase pays too much " - "(actual=%d vs limit=%d)", - block.vtx[0]->GetValueOut(), blockReward), + return state.DoS(100, + error("ConnectBlock(): coinbase pays too much " + "(actual=%d vs limit=%d)", + block.vtx[0]->GetValueOut(), blockReward), REJECT_INVALID, "bad-cb-amount"); } @@ -2054,8 +2056,8 @@ nLastSetChain = nNow; } } catch (const std::runtime_error &e) { - return AbortNode( - state, std::string("System error while flushing: ") + e.what()); + return AbortNode(state, std::string("System error while flushing: ") + + e.what()); } return true; } @@ -2317,9 +2319,10 @@ // Check that the request is consistent with current finalization. if (pindexFinalized && !AreOnTheSameFork(pindex, pindexFinalized)) { return state.DoS( - 20, error("%s: Trying to finalize block %s which conflicts " - "with already finalized block", - __func__, pindex->GetBlockHash().ToString()), + 20, + error("%s: Trying to finalize block %s which conflicts " + "with already finalized block", + __func__, pindex->GetBlockHash().ToString()), REJECT_AGAINST_FINALIZED, "bad-fork-prior-finalized"); } @@ -3459,8 +3462,9 @@ // Check that the block chain matches the known block chain up to a // checkpoint. if (!Checkpoints::CheckBlock(checkpoints, nHeight, hash)) { - return state.DoS(100, error("%s: rejected by checkpoint lock-in at %d", - __func__, nHeight), + return state.DoS(100, + error("%s: rejected by checkpoint lock-in at %d", + __func__, nHeight), REJECT_CHECKPOINT, "checkpoint mismatch"); } @@ -3679,9 +3683,8 @@ REJECT_INVALID, "bad-prevblk"); } - if (fCheckpointsEnabled && - !CheckIndexAgainstCheckpoint(pindexPrev, state, chainparams, - hash)) { + if (fCheckpointsEnabled && !CheckIndexAgainstCheckpoint( + pindexPrev, state, chainparams, hash)) { return error("%s: CheckIndexAgainstCheckpoint(): %s", __func__, state.GetRejectReason().c_str()); } @@ -4166,8 +4169,9 @@ } } - LogPrint(BCLog::PRUNE, "Prune: target=%dMiB actual=%dMiB diff=%dMiB " - "max_prune_height=%d removed %d blk/rev pairs\n", + LogPrint(BCLog::PRUNE, + "Prune: target=%dMiB actual=%dMiB diff=%dMiB " + "max_prune_height=%d removed %d blk/rev pairs\n", nPruneTarget / 1024 / 1024, nCurrentUsage / 1024 / 1024, ((int64_t)nPruneTarget - (int64_t)nCurrentUsage) / 1024 / 1024, nLastBlockWeCanPrune, count); @@ -4551,11 +4555,10 @@ boost::this_thread::interruption_point(); uiInterface.ShowProgress( _("Verifying blocks..."), - std::max(1, - std::min(99, - 100 - (int)(((double)(chainActive.Height() - - pindex->nHeight)) / - (double)nCheckDepth * 50)))); + std::max( + 1, std::min(99, 100 - (int)(((double)(chainActive.Height() - + pindex->nHeight)) / + (double)nCheckDepth * 50)))); pindex = chainActive.Next(pindex); CBlock block; if (!ReadBlockFromDisk(block, pindex, config)) { diff --git a/src/wallet/fees.h b/src/wallet/fees.h --- a/src/wallet/fees.h +++ b/src/wallet/fees.h @@ -23,9 +23,9 @@ const CTxMemPool &pool); /** -* Estimate the minimum fee considering required fee and targetFee or if 0 -* then fee estimation for nConfirmTarget -*/ + * Estimate the minimum fee considering required fee and targetFee or if 0 + * then fee estimation for nConfirmTarget + */ Amount GetMinimumFee(unsigned int nTxBytes, unsigned int nConfirmTarget, const CTxMemPool &pool, Amount targetFee); diff --git a/src/wallet/init.cpp b/src/wallet/init.cpp --- a/src/wallet/init.cpp +++ b/src/wallet/init.cpp @@ -109,8 +109,9 @@ "-zapwallettxes=", _("Delete all wallet transactions and only recover those parts of the " "blockchain through -rescan on startup") + - " " + _("(1 = keep tx meta data e.g. account owner and payment " - "request information, 2 = drop tx meta data)")); + " " + + _("(1 = keep tx meta data e.g. account owner and payment " + "request information, 2 = drop tx meta data)")); if (showDebug) { strUsage += HelpMessageGroup(_("Wallet debugging/testing options:")); diff --git a/src/wallet/rpcdump.cpp b/src/wallet/rpcdump.cpp --- a/src/wallet/rpcdump.cpp +++ b/src/wallet/rpcdump.cpp @@ -686,9 +686,8 @@ } CKey vchSecret; if (!pwallet->GetKey(*keyID, vchSecret)) { - throw JSONRPCError(RPC_WALLET_ERROR, - "Private key for address " + strAddress + - " is not known"); + throw JSONRPCError(RPC_WALLET_ERROR, "Private key for address " + + strAddress + " is not known"); } return CBitcoinSecret(vchSecret).ToString(); } diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -762,9 +762,8 @@ const CWalletTx &wtx = pairWtx.second; CValidationState state; - if (wtx.IsCoinBase() || - !ContextualCheckTransactionForCurrentBlock(config, *wtx.tx, - state)) { + if (wtx.IsCoinBase() || !ContextualCheckTransactionForCurrentBlock( + config, *wtx.tx, state)) { continue; } @@ -800,10 +799,11 @@ "transactions confirmed at least this many times.\n" "\nResult:\n" "amount (numeric) The total amount in " + - CURRENCY_UNIT + " received for this label.\n" - "\nExamples:\n" - "\nAmount received by the default label with at " - "least 1 confirmation\n" + + CURRENCY_UNIT + + " received for this label.\n" + "\nExamples:\n" + "\nAmount received by the default label with at least 1 " + "confirmation\n" + HelpExampleCli("getreceivedbylabel", "\"\"") + "\nAmount received at the tabby label including unconfirmed " "amounts with zero confirmations\n" + @@ -831,9 +831,8 @@ for (const std::pair &pairWtx : pwallet->mapWallet) { const CWalletTx &wtx = pairWtx.second; CValidationState state; - if (wtx.IsCoinBase() || - !ContextualCheckTransactionForCurrentBlock(config, *wtx.tx, - state)) { + if (wtx.IsCoinBase() || !ContextualCheckTransactionForCurrentBlock( + config, *wtx.tx, state)) { continue; } @@ -898,9 +897,10 @@ "balance in watch-only addresses (see 'importaddress')\n" "\nResult:\n" "amount (numeric) The total amount in " + - CURRENCY_UNIT + " received for this account.\n" - "\nExamples:\n" - "\nThe total amount in the wallet\n" + + CURRENCY_UNIT + + " received for this account.\n" + "\nExamples:\n" + "\nThe total amount in the wallet\n" + HelpExampleCli("getbalance", "") + "\nThe total amount in the wallet at least 5 blocks confirmed\n" + HelpExampleCli("getbalance", "\"*\" 6") + "\nAs a json rpc call\n" + @@ -983,8 +983,9 @@ CURRENCY_UNIT + " from the default account to the account named tabby\n" + HelpExampleCli("move", "\"\" \"tabby\" 0.01") + "\nMove 0.01 " + - CURRENCY_UNIT + " timotei to akiko with a comment and funds have 6 " - "confirmations\n" + + CURRENCY_UNIT + + " timotei to akiko with a comment and funds have 6 " + "confirmations\n" + HelpExampleCli("move", "\"timotei\" \"akiko\" 0.01 6 \"happy birthday!\"") + "\nAs a json rpc call\n" + @@ -1066,8 +1067,9 @@ "\"txid\" (string) The transaction id.\n" "\nExamples:\n" "\nSend 0.01 " + - CURRENCY_UNIT + " from the default account to the address, must " - "have at least 1 confirmation\n" + + CURRENCY_UNIT + + " from the default account to the address, must have at least 1 " + "confirmation\n" + HelpExampleCli("sendfrom", "\"\" \"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.01") + "\nSend 0.01 from the tabby account to the given address, funds " @@ -1418,9 +1420,8 @@ const CWalletTx &wtx = pairWtx.second; CValidationState state; - if (wtx.IsCoinBase() || - !ContextualCheckTransactionForCurrentBlock(config, *wtx.tx, - state)) { + if (wtx.IsCoinBase() || !ContextualCheckTransactionForCurrentBlock( + config, *wtx.tx, state)) { continue; } @@ -1962,9 +1963,9 @@ "}\n" "\nExamples:\n" "\nList account balances where there at least 1 confirmation\n" + - HelpExampleCli("listaccounts", "") + "\nList account balances " - "including zero confirmation " - "transactions\n" + + HelpExampleCli("listaccounts", "") + + "\nList account balances including zero confirmation " + "transactions\n" + HelpExampleCli("listaccounts", "0") + "\nList account balances for 6 or more confirmations\n" + HelpExampleCli("listaccounts", "6") + "\nAs json rpc call\n" + @@ -2237,14 +2238,15 @@ "either 'send' or 'receive'\n" " \"amount\" : x.xxx, (numeric) The amount " "in " + - CURRENCY_UNIT + "\n" - " \"label\" : \"label\", " - "(string) A comment for the address/transaction, " - "if any\n" - " \"vout\" : n, " - "(numeric) the vout value\n" - " \"fee\": x.xxx, " - "(numeric) The amount of the fee in " + + CURRENCY_UNIT + + "\n" + " \"label\" : \"label\", " + "(string) A comment for the address/transaction, " + "if any\n" + " \"vout\" : n, " + "(numeric) the vout value\n" + " \"fee\": x.xxx, " + "(numeric) The amount of the fee in " + CURRENCY_UNIT + ". This is negative and only available for the \n" " 'send' category of " @@ -2794,11 +2796,10 @@ } const UniValue &o = output.get_obj(); - RPCTypeCheckObj(o, - { - {"txid", UniValueType(UniValue::VSTR)}, - {"vout", UniValueType(UniValue::VNUM)}, - }); + RPCTypeCheckObj(o, { + {"txid", UniValueType(UniValue::VSTR)}, + {"vout", UniValueType(UniValue::VNUM)}, + }); std::string txid = find_value(o, "txid").get_str(); if (!IsHex(txid)) { @@ -2936,12 +2937,14 @@ "version\n" " \"balance\": xxxxxxx, (numeric) the total " "confirmed balance of the wallet in " + - CURRENCY_UNIT + "\n" - " \"unconfirmed_balance\": xxx, (numeric) " - "the total unconfirmed balance of the wallet in " + - CURRENCY_UNIT + "\n" - " \"immature_balance\": xxxxxx, (numeric) " - "the total immature balance of the wallet in " + + CURRENCY_UNIT + + "\n" + " \"unconfirmed_balance\": xxx, (numeric) " + "the total unconfirmed balance of the wallet in " + + CURRENCY_UNIT + + "\n" + " \"immature_balance\": xxxxxx, (numeric) " + "the total immature balance of the wallet in " + CURRENCY_UNIT + "\n" " \"txcount\": xxxxxxx, (numeric) the total number " @@ -2960,11 +2963,12 @@ "unlocked for transfers, or 0 if the wallet is locked\n" " \"paytxfee\": x.xxxx, (numeric) the transaction " "fee configuration, set in " + - CURRENCY_UNIT + "/kB\n" - " \"hdmasterkeyid\": \"\" (string) " - "the Hash160 of the HD master pubkey\n" - "}\n" - "\nExamples:\n" + + CURRENCY_UNIT + + "/kB\n" + " \"hdmasterkeyid\": \"\" (string) " + "the Hash160 of the HD master pubkey\n" + "}\n" + "\nExamples:\n" + HelpExampleCli("getwalletinfo", "") + HelpExampleRpc("getwalletinfo", "")); } @@ -3107,16 +3111,16 @@ " {\n" " \"minimumAmount\" (numeric or string, default=0) Minimum " "value of each UTXO in " + - CURRENCY_UNIT + "\n" - " \"maximumAmount\" (numeric or string, " - "default=unlimited) Maximum value of each UTXO " - "in " + - CURRENCY_UNIT + "\n" - " \"maximumCount\" (numeric or string, " - "default=unlimited) Maximum number of UTXOs\n" - " \"minimumSumAmount\" (numeric or string, " - "default=unlimited) Minimum sum value of all UTXOs " - "in " + + CURRENCY_UNIT + + "\n" + " \"maximumAmount\" (numeric or string, default=unlimited) " + "Maximum value of each UTXO in " + + CURRENCY_UNIT + + "\n" + " \"maximumCount\" (numeric or string, default=unlimited) " + "Maximum number of UTXOs\n" + " \"minimumSumAmount\" (numeric or string, default=unlimited) " + "Minimum sum value of all UTXOs in " + CURRENCY_UNIT + "\n" " }\n" @@ -3361,12 +3365,13 @@ " \"hex\": \"value\", (string) The resulting raw " "transaction (hex-encoded string)\n" " \"fee\": n, (numeric) Fee in " + - CURRENCY_UNIT + " the resulting transaction pays\n" - " \"changepos\": n (numeric) The " - "position of the added change output, or -1\n" - "}\n" - "\nExamples:\n" - "\nCreate a transaction with no inputs\n" + + CURRENCY_UNIT + + " the resulting transaction pays\n" + " \"changepos\": n (numeric) The position of the added " + "change output, or -1\n" + "}\n" + "\nExamples:\n" + "\nCreate a transaction with no inputs\n" + HelpExampleCli("createrawtransaction", "\"[]\" \"{\\\"myaddress\\\":0.01}\"") + "\nAdd sufficient unsigned inputs to meet the output value\n" + diff --git a/src/wallet/test/crypto_tests.cpp b/src/wallet/test/crypto_tests.cpp --- a/src/wallet/test/crypto_tests.cpp +++ b/src/wallet/test/crypto_tests.cpp @@ -214,9 +214,10 @@ const std::vector &vchPlaintextIn, const std::vector &vchCiphertextCorrect = std::vector()) { - TestEncryptSingle(crypt, CKeyingMaterial(vchPlaintextIn.begin(), - vchPlaintextIn.end()), - vchCiphertextCorrect); + TestEncryptSingle( + crypt, + CKeyingMaterial(vchPlaintextIn.begin(), vchPlaintextIn.end()), + vchCiphertextCorrect); for (std::vector::const_iterator i(vchPlaintextIn.begin()); i != vchPlaintextIn.end(); ++i) TestEncryptSingle(crypt, CKeyingMaterial(i, vchPlaintextIn.end())); diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -202,17 +202,15 @@ // child-index-range // example: 1 | BIP32_HARDENED_KEY_LIMIT == 0x80000001 == 2147483649 if (internal) { - chainChildKey.Derive(childKey, - hdChain.nInternalChainCounter | - BIP32_HARDENED_KEY_LIMIT); + chainChildKey.Derive(childKey, hdChain.nInternalChainCounter | + BIP32_HARDENED_KEY_LIMIT); metadata.hdKeypath = "m/0'/1'/" + std::to_string(hdChain.nInternalChainCounter) + "'"; hdChain.nInternalChainCounter++; } else { - chainChildKey.Derive(childKey, - hdChain.nExternalChainCounter | - BIP32_HARDENED_KEY_LIMIT); + chainChildKey.Derive(childKey, hdChain.nExternalChainCounter | + BIP32_HARDENED_KEY_LIMIT); metadata.hdKeypath = "m/0'/0'/" + std::to_string(hdChain.nExternalChainCounter) + "'"; @@ -1721,12 +1719,12 @@ if (pindex->nHeight % 100 == 0 && dProgressTip - dProgressStart > 0.0) { ShowProgress( _("Rescanning..."), - std::max(1, std::min(99, - (GuessVerificationProgress( - chainParams.TxData(), pindex) - - dProgressStart) / - (dProgressTip - dProgressStart) * - 100))); + std::max(1, + std::min(99, (GuessVerificationProgress( + chainParams.TxData(), pindex) - + dProgressStart) / + (dProgressTip - dProgressStart) * + 100))); } CBlock block; diff --git a/src/wallet/walletdb.cpp b/src/wallet/walletdb.cpp --- a/src/wallet/walletdb.cpp +++ b/src/wallet/walletdb.cpp @@ -728,8 +728,9 @@ if ((*it) == txid) { if (!EraseTx(txid)) { - LogPrint(BCLog::DB, "Transaction was found for deletion but " - "returned database error: %s\n", + LogPrint(BCLog::DB, + "Transaction was found for deletion but returned " + "database error: %s\n", txid.GetHex()); delerror = true; }