Skip to content

Commit 7721ad6

Browse files
TheBlueMattsdaftuar
authored andcommitted
[refactor] Prep for scripted-diff by removing some \ns which annoy sed.
1 parent 5e78c57 commit 7721ad6

File tree

2 files changed

+9
-16
lines changed

2 files changed

+9
-16
lines changed

src/consensus/tx_verify.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,7 @@ bool Consensus::CheckTxInputs(const CTransaction& tx, CValidationState& state, c
172172

173173
// If prev is coinbase, check that it's matured
174174
if (coin.IsCoinBase() && nSpendHeight - coin.nHeight < COINBASE_MATURITY) {
175-
return state.DoS(0, ValidationInvalidReason::TX_MISSING_INPUTS, false,
176-
REJECT_INVALID, "bad-txns-premature-spend-of-coinbase", false,
175+
return state.DoS(0, ValidationInvalidReason::TX_MISSING_INPUTS, false, REJECT_INVALID, "bad-txns-premature-spend-of-coinbase", false,
177176
strprintf("tried to spend coinbase at depth %d", nSpendHeight - coin.nHeight));
178177
}
179178

src/validation.cpp

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -760,8 +760,7 @@ static bool AcceptToMemoryPoolWorker(const CChainParams& chainparams, CTxMemPool
760760
const uint256 &hashAncestor = ancestorIt->GetTx().GetHash();
761761
if (setConflicts.count(hashAncestor))
762762
{
763-
return state.DoS(100, ValidationInvalidReason::CONSENSUS, false,
764-
REJECT_INVALID, "bad-txns-spends-conflicting-tx", false,
763+
return state.DoS(100, ValidationInvalidReason::CONSENSUS, false, REJECT_INVALID, "bad-txns-spends-conflicting-tx", false,
765764
strprintf("%s spends conflicting transaction %s",
766765
hash.ToString(),
767766
hashAncestor.ToString()));
@@ -803,8 +802,7 @@ static bool AcceptToMemoryPoolWorker(const CChainParams& chainparams, CTxMemPool
803802
CFeeRate oldFeeRate(mi->GetModifiedFee(), mi->GetTxSize());
804803
if (newFeeRate <= oldFeeRate)
805804
{
806-
return state.DoS(0, ValidationInvalidReason::TX_MEMPOOL_POLICY, false,
807-
REJECT_INSUFFICIENTFEE, "insufficient fee", false,
805+
return state.DoS(0, ValidationInvalidReason::TX_MEMPOOL_POLICY, false, REJECT_INSUFFICIENTFEE, "insufficient fee", false,
808806
strprintf("rejecting replacement %s; new feerate %s <= old feerate %s",
809807
hash.ToString(),
810808
newFeeRate.ToString(),
@@ -832,8 +830,7 @@ static bool AcceptToMemoryPoolWorker(const CChainParams& chainparams, CTxMemPool
832830
nConflictingSize += it->GetTxSize();
833831
}
834832
} else {
835-
return state.DoS(0, ValidationInvalidReason::TX_MEMPOOL_POLICY, false,
836-
REJECT_NONSTANDARD, "too many potential replacements", false,
833+
return state.DoS(0, ValidationInvalidReason::TX_MEMPOOL_POLICY, false, REJECT_NONSTANDARD, "too many potential replacements", false,
837834
strprintf("rejecting replacement %s; too many potential replacements (%d > %d)\n",
838835
hash.ToString(),
839836
nConflictingCount,
@@ -852,8 +849,7 @@ static bool AcceptToMemoryPoolWorker(const CChainParams& chainparams, CTxMemPool
852849
// it's cheaper to just check if the new input refers to a
853850
// tx that's in the mempool.
854851
if (pool.exists(tx.vin[j].prevout.hash)) {
855-
return state.DoS(0, ValidationInvalidReason::TX_MEMPOOL_POLICY, false,
856-
REJECT_NONSTANDARD, "replacement-adds-unconfirmed", false,
852+
return state.DoS(0, ValidationInvalidReason::TX_MEMPOOL_POLICY, false, REJECT_NONSTANDARD, "replacement-adds-unconfirmed", false,
857853
strprintf("replacement %s adds unconfirmed input, idx %d",
858854
hash.ToString(), j));
859855
}
@@ -865,8 +861,7 @@ static bool AcceptToMemoryPoolWorker(const CChainParams& chainparams, CTxMemPool
865861
// transactions would not be paid for.
866862
if (nModifiedFees < nConflictingFees)
867863
{
868-
return state.DoS(0, ValidationInvalidReason::TX_MEMPOOL_POLICY, false,
869-
REJECT_INSUFFICIENTFEE, "insufficient fee", false,
864+
return state.DoS(0, ValidationInvalidReason::TX_MEMPOOL_POLICY, false, REJECT_INSUFFICIENTFEE, "insufficient fee", false,
870865
strprintf("rejecting replacement %s, less fees than conflicting txs; %s < %s",
871866
hash.ToString(), FormatMoney(nModifiedFees), FormatMoney(nConflictingFees)));
872867
}
@@ -876,8 +871,7 @@ static bool AcceptToMemoryPoolWorker(const CChainParams& chainparams, CTxMemPool
876871
CAmount nDeltaFees = nModifiedFees - nConflictingFees;
877872
if (nDeltaFees < ::incrementalRelayFee.GetFee(nSize))
878873
{
879-
return state.DoS(0, ValidationInvalidReason::TX_MEMPOOL_POLICY, false,
880-
REJECT_INSUFFICIENTFEE, "insufficient fee", false,
874+
return state.DoS(0, ValidationInvalidReason::TX_MEMPOOL_POLICY, false, REJECT_INSUFFICIENTFEE, "insufficient fee", false,
881875
strprintf("rejecting replacement %s, not enough additional fees to relay; %s < %s",
882876
hash.ToString(),
883877
FormatMoney(nDeltaFees),
@@ -899,7 +893,7 @@ static bool AcceptToMemoryPoolWorker(const CChainParams& chainparams, CTxMemPool
899893
!CheckInputs(tx, stateDummy, view, true, scriptVerifyFlags & ~SCRIPT_VERIFY_CLEANSTACK, true, false, txdata)) {
900894
// Only the witness is missing, so the transaction itself may be fine.
901895
state.DoS(0, ValidationInvalidReason::TX_WITNESS_MUTATED, false,
902-
state.GetRejectCode(), state.GetRejectReason(), true, state.GetDebugMessage());
896+
state.GetRejectCode(), state.GetRejectReason(), true, state.GetDebugMessage());
903897
}
904898
return false; // state filled in by CheckInputs
905899
}
@@ -1970,7 +1964,7 @@ bool CChainState::ConnectBlock(const CBlock& block, CValidationState& state, CBl
19701964
// CheckTxInputs may return MISSING_INPUTS but we can't return that, as
19711965
// it's not defined for a block, so we reset the reason flag to CONSENSUS here.
19721966
state.DoS(100, ValidationInvalidReason::CONSENSUS, false,
1973-
state.GetRejectCode(), state.GetRejectReason(), state.CorruptionPossible(), state.GetDebugMessage());
1967+
state.GetRejectCode(), state.GetRejectReason(), state.CorruptionPossible(), state.GetDebugMessage());
19741968
}
19751969
return error("%s: Consensus::CheckTxInputs: %s, %s", __func__, tx.GetHash().ToString(), FormatStateMessage(state));
19761970
}

0 commit comments

Comments
 (0)