mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
Merge 87257d860e into merged_master (Bitcoin PR bitcoin/bitcoin#22532)
This commit is contained in:
commit
2fc4d3b485
1 changed files with 4 additions and 8 deletions
|
|
@ -4,9 +4,10 @@
|
|||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
"""
|
||||
Test mempool acceptance in case of an already known transaction
|
||||
with identical non-witness data different witness.
|
||||
with identical non-witness data but different witness.
|
||||
"""
|
||||
|
||||
from copy import deepcopy
|
||||
from test_framework.messages import (
|
||||
COIN,
|
||||
COutPoint,
|
||||
|
|
@ -81,11 +82,7 @@ class MempoolWtxidTest(BitcoinTestFramework):
|
|||
child_one_txid = child_one.rehash()
|
||||
|
||||
# Create another identical transaction with witness solving second branch
|
||||
child_two = CTransaction()
|
||||
child_two.vin.append(CTxIn(COutPoint(int(parent_txid, 16), 0), b""))
|
||||
child_two.vout.append(CTxOut(int(9.99996 * COIN), child_script_pubkey))
|
||||
child_two.vout.append(CTxOut(int(0.00002 * COIN))) ## fee
|
||||
child_two.wit.vtxinwit.append(CTxInWitness())
|
||||
child_two = deepcopy(child_one)
|
||||
child_two.wit.vtxinwit[0].scriptWitness.stack = [b'', witness_script]
|
||||
child_two_wtxid = child_two.getwtxid()
|
||||
child_two_txid = child_two.rehash()
|
||||
|
|
@ -107,8 +104,7 @@ class MempoolWtxidTest(BitcoinTestFramework):
|
|||
"allowed": False,
|
||||
"reject-reason": "txn-already-in-mempool"
|
||||
}])
|
||||
testres_child_two = node.testmempoolaccept([child_two.serialize().hex()])[0]
|
||||
assert_equal(testres_child_two, {
|
||||
assert_equal(node.testmempoolaccept([child_two.serialize().hex()])[0], {
|
||||
"txid": child_two_txid,
|
||||
"wtxid": child_two_wtxid,
|
||||
"allowed": False,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue