Skip to content
This repository has been archived by the owner on Feb 1, 2021. It is now read-only.

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg-Griffith committed May 22, 2019
1 parent f68cebf commit 10afdcc
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 21 deletions.
3 changes: 1 addition & 2 deletions src/chain/tx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,7 @@ unsigned int CTransaction::CalculateModifiedSize(unsigned int nTxSize) const
std::string CTransaction::ToString() const
{
std::string str;
str += strprintf(
"CTransaction(hash=%s, ver=%d, nTime=%u, vin.size=%u, vout.size=%u, nLockTime=%u)\n",
str += strprintf("CTransaction(hash=%s, ver=%d, nTime=%u, vin.size=%u, vout.size=%u, nLockTime=%u)\n",
GetHash().ToString().substr(0, 10), nVersion, nTime, vin.size(), vout.size(), nLockTime);
for (unsigned int i = 0; i < vin.size(); i++)
str += " " + vin[i].ToString() + "\n";
Expand Down
12 changes: 3 additions & 9 deletions src/coins.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,7 @@ class Coin
}

//! empty constructor
Coin()
{
Clear();
}
Coin() { Clear(); }
bool IsCoinBase() const { return fCoinBase; }
bool IsCoinStake() const { return fCoinStake; }
template <typename Stream>
Expand Down Expand Up @@ -299,7 +296,7 @@ class CCoinsViewCache : public CCoinsViewBacked
* more efficient than GetCoin. Modifications to other cache entries are
* allowed while accessing the returned pointer.
*/
const Coin &_AccessCoin(const COutPoint &output) const;
const Coin &_AccessCoin(const COutPoint &output) const;

/**
* Add a coin. Set potential_overwrite to true if a non-pruned version may
Expand Down Expand Up @@ -433,10 +430,7 @@ void AddCoins(CCoinsViewCache &cache, const CTransaction &tx, int nHeight);

/** Apply the effects of this transaction on the UTXO set represented by view */
void UpdateCoins(const CTransaction &tx, CCoinsViewCache &inputs, int nHeight);
void UpdateCoins(const CTransaction &tx,
CCoinsViewCache &inputs,
CTxUndo &txundo,
int nHeight);
void UpdateCoins(const CTransaction &tx, CCoinsViewCache &inputs, CTxUndo &txundo, int nHeight);


#endif // BITCOIN_COINS_H
2 changes: 1 addition & 1 deletion src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ bool CheckInputs(const CTransaction &tx,
unsigned int flags,
bool cacheStore,
std::vector<CScriptCheck> *pvChecks = nullptr);

/**
* Check if transaction is final and can be included in a block with the
* specified height and time. Consensus critical.
Expand Down
8 changes: 4 additions & 4 deletions src/processblock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,8 @@ bool ActivateBestChainStep(CValidationState &state,
for (auto i = vpindexToConnect.rbegin(); i != vpindexToConnect.rend(); i++)
{
CBlockIndex *pindexConnect = *i;
if (!ConnectTip(state, chainparams, pindexConnect, pindexConnect == pindexMostWork && fBlock ? pblock : nullptr))
if (!ConnectTip(
state, chainparams, pindexConnect, pindexConnect == pindexMostWork && fBlock ? pblock : nullptr))
{
if (state.IsInvalid())
{
Expand Down Expand Up @@ -568,8 +569,7 @@ bool ActivateBestChainStep(CValidationState &state,

// Relay inventory, but don't relay old inventory during initial block download.
const int nNewHeight = pindexNewTip->nHeight;
g_connman->ForEachNode([nNewHeight, &vHashes](CNode *pnode)
{
g_connman->ForEachNode([nNewHeight, &vHashes](CNode *pnode) {
if (nNewHeight > (pnode->nStartingHeight != -1 ? pnode->nStartingHeight - 2000 : 0))
{
for (const uint256 &hash : boost::adaptors::reverse(vHashes))
Expand Down Expand Up @@ -624,7 +624,7 @@ bool ActivateBestChain(CValidationState &state, const CNetworkTemplate &chainpar
if (pnetMan->getChainActive()->chainActive.Tip() != nullptr)
{
if (pindexMostWork->nChainWork <= pnetMan->getChainActive()->chainActive.Tip()->nChainWork)
return true;
return true;
}
if (!ActivateBestChainStep(state, chainparams, pindexMostWork,
pblock && pblock->GetHash() == pindexMostWork->GetBlockHash() ? pblock : nullptr))
Expand Down
4 changes: 1 addition & 3 deletions src/processblock.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ bool ConnectBlock(const CBlock &block,
* In case pfClean is provided, operation will try to be tolerant about errors, and *pfClean
* will be true if no problems were found. Otherwise, the return value will be false in case
* of problems. Note that in any case, coins may be modified. */
DisconnectResult DisconnectBlock(const CBlock &block,
const CBlockIndex *pindex,
CCoinsViewCache &coins);
DisconnectResult DisconnectBlock(const CBlock &block, const CBlockIndex *pindex, CCoinsViewCache &coins);

/** Find the best known block, and make it the tip of the block chain */
bool ActivateBestChain(CValidationState &state, const CNetworkTemplate &chainparams, const CBlock *pblock = nullptr);
Expand Down
2 changes: 1 addition & 1 deletion src/rpc/rpcblockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ UniValue gettxout(const UniValue &params, bool fHelp)
if ((unsigned int)coin.nHeight == MEMPOOL_HEIGHT)
ret.push_back(Pair("confirmations", 0));
else
ret.push_back(Pair("confirmations", (int64_t)(pindex->nHeight - coin.nHeight + 1) ));
ret.push_back(Pair("confirmations", (int64_t)(pindex->nHeight - coin.nHeight + 1)));
ret.push_back(Pair("value", ValueFromAmount(coin.out.nValue)));
UniValue o(UniValue::VOBJ);
ScriptPubKeyToJSON(coin.out.scriptPubKey, o, true);
Expand Down
3 changes: 2 additions & 1 deletion src/rpc/rpcrawtransaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,8 @@ UniValue gettxoutproof(const UniValue &params, bool fHelp)
else
{
CoinAccessor coin(*pnetMan->getChainActive()->pcoinsTip, oneTxid);
if (coin && !coin->IsSpent() && coin->nHeight > 0 && coin->nHeight <= pnetMan->getChainActive()->chainActive.Height())
if (coin && !coin->IsSpent() && coin->nHeight > 0 &&
coin->nHeight <= pnetMan->getChainActive()->chainActive.Height())
{
pblockindex = pnetMan->getChainActive()->chainActive[coin->nHeight];
}
Expand Down

0 comments on commit 10afdcc

Please sign in to comment.