mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-28 13:02:38 +02:00
Support overriding txn-spk-reused rejections via sendrawtransaction
This commit is contained in:
parent
a7112699a0
commit
406243e7c9
@ -842,6 +842,9 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
|
||||
}
|
||||
|
||||
auto spk_reuse_mode = SpkReuseMode;
|
||||
if (ignore_rejects.count("txn-spk-reused")) {
|
||||
spk_reuse_mode = SRM_ALLOW;
|
||||
}
|
||||
SPKStates_t mapSPK;
|
||||
|
||||
// Check for conflicts with in-memory transactions
|
||||
@ -897,7 +900,7 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
|
||||
}
|
||||
}
|
||||
if (mapSPK.find(hashSPK) != mapSPK.end()) {
|
||||
return state.Invalid(TxValidationResult::TX_MEMPOOL_POLICY, "txn-spk-reused-twinoutputs");
|
||||
MaybeReject(TxValidationResult::TX_MEMPOOL_POLICY, "txn-spk-reused-twinoutputs");
|
||||
}
|
||||
mapSPK[hashSPK] = MemPool_SPK_State(mapSPK[hashSPK] | MSS_CREATED);
|
||||
}
|
||||
@ -963,7 +966,7 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
|
||||
SPKStates_t::iterator mssit = mapSPK.find(hashSPK);
|
||||
if (mssit != mapSPK.end()) {
|
||||
if (mssit->second & MSS_CREATED) {
|
||||
return state.Invalid(TxValidationResult::TX_MEMPOOL_POLICY, "txn-spk-reused-change");
|
||||
MaybeReject(TxValidationResult::TX_MEMPOOL_POLICY, "txn-spk-reused-change");
|
||||
}
|
||||
}
|
||||
const auto& SPKit = m_pool.mapUsedSPK.find(hashSPK);
|
||||
@ -1161,7 +1164,7 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
|
||||
return state.Invalid(TxValidationResult::TX_CONSENSUS, "bad-txns-spends-conflicting-tx", *err_string);
|
||||
}
|
||||
if (has_policy_conflict) {
|
||||
return state.Invalid(TxValidationResult::TX_MEMPOOL_POLICY, "txn-spk-reused-chained");
|
||||
MaybeReject(TxValidationResult::TX_MEMPOOL_POLICY, "txn-spk-reused-chained");
|
||||
}
|
||||
|
||||
// We want to detect conflicts in any tx in a package to trigger package RBF logic
|
||||
|
Loading…
Reference in New Issue
Block a user