mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-18 13:17:55 +02:00
Disable replacement of peg-in transactions
This commit is contained in:
parent
3db5ff1e03
commit
6939698bc5
1 changed files with 4 additions and 0 deletions
|
|
@ -1262,11 +1262,15 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C
|
|||
if (!view.HaveInputs(tx))
|
||||
return state.Invalid(false, REJECT_DUPLICATE, "bad-txns-inputs-spent");
|
||||
|
||||
// We disable replacement of peg-ins as they are spendable-by-anyone
|
||||
BOOST_FOREACH(const CTxIn &txin, tx.vin)
|
||||
{
|
||||
CCoins coins;
|
||||
assert(view.GetCoins(txin.prevout.hash, coins));
|
||||
if (coins.vout[txin.prevout.n].scriptPubKey.IsWithdrawLock() && txin.scriptSig.IsWithdrawProof()) {
|
||||
if (pool.mapNextTx.count(txin.prevout))
|
||||
return state.Invalid(false, REJECT_CONFLICT, "txn-mempool-replace-withdraw");
|
||||
|
||||
pair<uint256, COutPoint> outpoint = make_pair(coins.vout[txin.prevout.n].scriptPubKey.GetWithdrawLockGenesisHash(), txin.scriptSig.GetWithdrawSpent());
|
||||
if (view.IsWithdrawSpent(outpoint))
|
||||
return state.Invalid(false, REJECT_CONFLICT, "withdraw-already-claimed");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue