mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-08 10:31:50 -05:00
test: refactor: add constant for sequence number SEQUENCE_FINAL
This commit is contained in:
parent
c561f2f06e
commit
2f79786822
8 changed files with 32 additions and 20 deletions
|
@ -28,6 +28,7 @@ from test_framework.messages import (
|
||||||
CTxIn,
|
CTxIn,
|
||||||
CTxOut,
|
CTxOut,
|
||||||
MAX_MONEY,
|
MAX_MONEY,
|
||||||
|
SEQUENCE_FINAL,
|
||||||
)
|
)
|
||||||
from test_framework.blocktools import create_tx_with_script, MAX_BLOCK_SIGOPS
|
from test_framework.blocktools import create_tx_with_script, MAX_BLOCK_SIGOPS
|
||||||
from test_framework.script import (
|
from test_framework.script import (
|
||||||
|
@ -77,7 +78,7 @@ class BadTxTemplate:
|
||||||
def __init__(self, *, spend_tx=None, spend_block=None):
|
def __init__(self, *, spend_tx=None, spend_block=None):
|
||||||
self.spend_tx = spend_block.vtx[0] if spend_block else spend_tx
|
self.spend_tx = spend_block.vtx[0] if spend_block else spend_tx
|
||||||
self.spend_avail = sum(o.nValue for o in self.spend_tx.vout)
|
self.spend_avail = sum(o.nValue for o in self.spend_tx.vout)
|
||||||
self.valid_txin = CTxIn(COutPoint(self.spend_tx.sha256, 0), b"", 0xffffffff)
|
self.valid_txin = CTxIn(COutPoint(self.spend_tx.sha256, 0), b"", SEQUENCE_FINAL)
|
||||||
|
|
||||||
@abc.abstractmethod
|
@abc.abstractmethod
|
||||||
def get_tx(self, *args, **kwargs):
|
def get_tx(self, *args, **kwargs):
|
||||||
|
@ -137,7 +138,7 @@ class BadInputOutpointIndex(BadTxTemplate):
|
||||||
bad_idx = num_indices + 100
|
bad_idx = num_indices + 100
|
||||||
|
|
||||||
tx = CTransaction()
|
tx = CTransaction()
|
||||||
tx.vin.append(CTxIn(COutPoint(self.spend_tx.sha256, bad_idx), b"", 0xffffffff))
|
tx.vin.append(CTxIn(COutPoint(self.spend_tx.sha256, bad_idx), b"", SEQUENCE_FINAL))
|
||||||
tx.vout.append(CTxOut(0, basic_p2sh))
|
tx.vout.append(CTxOut(0, basic_p2sh))
|
||||||
tx.calc_sha256()
|
tx.calc_sha256()
|
||||||
return tx
|
return tx
|
||||||
|
@ -175,7 +176,7 @@ class NonexistentInput(BadTxTemplate):
|
||||||
|
|
||||||
def get_tx(self):
|
def get_tx(self):
|
||||||
tx = CTransaction()
|
tx = CTransaction()
|
||||||
tx.vin.append(CTxIn(COutPoint(self.spend_tx.sha256 + 1, 0), b"", 0xffffffff))
|
tx.vin.append(CTxIn(COutPoint(self.spend_tx.sha256 + 1, 0), b"", SEQUENCE_FINAL))
|
||||||
tx.vin.append(self.valid_txin)
|
tx.vin.append(self.valid_txin)
|
||||||
tx.vout.append(CTxOut(1, basic_p2sh))
|
tx.vout.append(CTxOut(1, basic_p2sh))
|
||||||
tx.calc_sha256()
|
tx.calc_sha256()
|
||||||
|
|
|
@ -23,6 +23,7 @@ from test_framework.messages import (
|
||||||
CTxIn,
|
CTxIn,
|
||||||
CTxOut,
|
CTxOut,
|
||||||
MAX_BLOCK_WEIGHT,
|
MAX_BLOCK_WEIGHT,
|
||||||
|
SEQUENCE_FINAL,
|
||||||
uint256_from_compact,
|
uint256_from_compact,
|
||||||
uint256_from_str,
|
uint256_from_str,
|
||||||
)
|
)
|
||||||
|
@ -50,9 +51,13 @@ from test_framework.script_util import (
|
||||||
script_to_p2sh_script,
|
script_to_p2sh_script,
|
||||||
)
|
)
|
||||||
from test_framework.test_framework import BitcoinTestFramework
|
from test_framework.test_framework import BitcoinTestFramework
|
||||||
from test_framework.util import assert_equal
|
from test_framework.util import (
|
||||||
|
assert_equal,
|
||||||
|
assert_greater_than,
|
||||||
|
)
|
||||||
from data import invalid_txs
|
from data import invalid_txs
|
||||||
|
|
||||||
|
|
||||||
# Use this class for tests that require behavior other than normal p2p behavior.
|
# Use this class for tests that require behavior other than normal p2p behavior.
|
||||||
# For now, it is used to serialize a bloated varint (b64).
|
# For now, it is used to serialize a bloated varint (b64).
|
||||||
class CBrokenBlock(CBlock):
|
class CBrokenBlock(CBlock):
|
||||||
|
@ -801,7 +806,7 @@ class FullBlockTest(BitcoinTestFramework):
|
||||||
b58 = self.next_block(58, spend=out[17])
|
b58 = self.next_block(58, spend=out[17])
|
||||||
tx = CTransaction()
|
tx = CTransaction()
|
||||||
assert len(out[17].vout) < 42
|
assert len(out[17].vout) < 42
|
||||||
tx.vin.append(CTxIn(COutPoint(out[17].sha256, 42), CScript([OP_TRUE]), 0xffffffff))
|
tx.vin.append(CTxIn(COutPoint(out[17].sha256, 42), CScript([OP_TRUE]), SEQUENCE_FINAL))
|
||||||
tx.vout.append(CTxOut(0, b""))
|
tx.vout.append(CTxOut(0, b""))
|
||||||
tx.calc_sha256()
|
tx.calc_sha256()
|
||||||
b58 = self.update_block(58, [tx])
|
b58 = self.update_block(58, [tx])
|
||||||
|
@ -876,7 +881,7 @@ class FullBlockTest(BitcoinTestFramework):
|
||||||
tx.nLockTime = 0xffffffff # this locktime is non-final
|
tx.nLockTime = 0xffffffff # this locktime is non-final
|
||||||
tx.vin.append(CTxIn(COutPoint(out[18].sha256, 0))) # don't set nSequence
|
tx.vin.append(CTxIn(COutPoint(out[18].sha256, 0))) # don't set nSequence
|
||||||
tx.vout.append(CTxOut(0, CScript([OP_TRUE])))
|
tx.vout.append(CTxOut(0, CScript([OP_TRUE])))
|
||||||
assert tx.vin[0].nSequence < 0xffffffff
|
assert_greater_than(SEQUENCE_FINAL, tx.vin[0].nSequence)
|
||||||
tx.calc_sha256()
|
tx.calc_sha256()
|
||||||
b62 = self.update_block(62, [tx])
|
b62 = self.update_block(62, [tx])
|
||||||
self.send_blocks([b62], success=False, reject_reason='bad-txns-nonfinal', reconnect=True)
|
self.send_blocks([b62], success=False, reject_reason='bad-txns-nonfinal', reconnect=True)
|
||||||
|
@ -1024,7 +1029,7 @@ class FullBlockTest(BitcoinTestFramework):
|
||||||
bogus_tx = CTransaction()
|
bogus_tx = CTransaction()
|
||||||
bogus_tx.sha256 = uint256_from_str(b"23c70ed7c0506e9178fc1a987f40a33946d4ad4c962b5ae3a52546da53af0c5c")
|
bogus_tx.sha256 = uint256_from_str(b"23c70ed7c0506e9178fc1a987f40a33946d4ad4c962b5ae3a52546da53af0c5c")
|
||||||
tx = CTransaction()
|
tx = CTransaction()
|
||||||
tx.vin.append(CTxIn(COutPoint(bogus_tx.sha256, 0), b"", 0xffffffff))
|
tx.vin.append(CTxIn(COutPoint(bogus_tx.sha256, 0), b"", SEQUENCE_FINAL))
|
||||||
tx.vout.append(CTxOut(1, b""))
|
tx.vout.append(CTxOut(1, b""))
|
||||||
b70 = self.update_block(70, [tx])
|
b70 = self.update_block(70, [tx])
|
||||||
self.send_blocks([b70], success=False, reject_reason='bad-txns-inputs-missingorspent', reconnect=True)
|
self.send_blocks([b70], success=False, reject_reason='bad-txns-inputs-missingorspent', reconnect=True)
|
||||||
|
|
|
@ -13,6 +13,7 @@ from test_framework.blocktools import (
|
||||||
)
|
)
|
||||||
from test_framework.messages import (
|
from test_framework.messages import (
|
||||||
CTransaction,
|
CTransaction,
|
||||||
|
SEQUENCE_FINAL,
|
||||||
msg_block,
|
msg_block,
|
||||||
)
|
)
|
||||||
from test_framework.p2p import P2PInterface
|
from test_framework.p2p import P2PInterface
|
||||||
|
@ -53,7 +54,7 @@ def cltv_invalidate(tx, failure_reason):
|
||||||
# 3) the lock-time type (height vs. timestamp) of the top stack item and the
|
# 3) the lock-time type (height vs. timestamp) of the top stack item and the
|
||||||
# nLockTime field are not the same
|
# nLockTime field are not the same
|
||||||
# 4) the top stack item is greater than the transaction's nLockTime field
|
# 4) the top stack item is greater than the transaction's nLockTime field
|
||||||
# 5) the nSequence field of the txin is 0xffffffff
|
# 5) the nSequence field of the txin is 0xffffffff (SEQUENCE_FINAL)
|
||||||
assert failure_reason in range(5)
|
assert failure_reason in range(5)
|
||||||
scheme = [
|
scheme = [
|
||||||
# | Script to prepend to scriptSig | nSequence | nLockTime |
|
# | Script to prepend to scriptSig | nSequence | nLockTime |
|
||||||
|
@ -62,7 +63,7 @@ def cltv_invalidate(tx, failure_reason):
|
||||||
[[OP_1NEGATE, OP_CHECKLOCKTIMEVERIFY, OP_DROP], None, None],
|
[[OP_1NEGATE, OP_CHECKLOCKTIMEVERIFY, OP_DROP], None, None],
|
||||||
[[CScriptNum(100), OP_CHECKLOCKTIMEVERIFY, OP_DROP], 0, 1296688602], # timestamp of genesis block
|
[[CScriptNum(100), OP_CHECKLOCKTIMEVERIFY, OP_DROP], 0, 1296688602], # timestamp of genesis block
|
||||||
[[CScriptNum(100), OP_CHECKLOCKTIMEVERIFY, OP_DROP], 0, 50],
|
[[CScriptNum(100), OP_CHECKLOCKTIMEVERIFY, OP_DROP], 0, 50],
|
||||||
[[CScriptNum(50), OP_CHECKLOCKTIMEVERIFY, OP_DROP], 0xffffffff, 50],
|
[[CScriptNum(50), OP_CHECKLOCKTIMEVERIFY, OP_DROP], SEQUENCE_FINAL, 50],
|
||||||
][failure_reason]
|
][failure_reason]
|
||||||
|
|
||||||
cltv_modify_tx(tx, prepend_scriptsig=scheme[0], nsequence=scheme[1], nlocktime=scheme[2])
|
cltv_modify_tx(tx, prepend_scriptsig=scheme[0], nsequence=scheme[1], nlocktime=scheme[2])
|
||||||
|
|
|
@ -14,6 +14,7 @@ from test_framework.messages import (
|
||||||
CTransaction,
|
CTransaction,
|
||||||
CTxIn,
|
CTxIn,
|
||||||
CTxOut,
|
CTxOut,
|
||||||
|
SEQUENCE_FINAL,
|
||||||
)
|
)
|
||||||
from test_framework.script import CScript, OP_DROP
|
from test_framework.script import CScript, OP_DROP
|
||||||
from test_framework.test_framework import BitcoinTestFramework
|
from test_framework.test_framework import BitcoinTestFramework
|
||||||
|
@ -402,7 +403,7 @@ class ReplaceByFeeTest(BitcoinTestFramework):
|
||||||
|
|
||||||
# Create a non-opting in transaction
|
# Create a non-opting in transaction
|
||||||
tx1a = CTransaction()
|
tx1a = CTransaction()
|
||||||
tx1a.vin = [CTxIn(tx0_outpoint, nSequence=0xffffffff)]
|
tx1a.vin = [CTxIn(tx0_outpoint, nSequence=SEQUENCE_FINAL)]
|
||||||
tx1a.vout = [CTxOut(1 * COIN, DUMMY_P2WPKH_SCRIPT)]
|
tx1a.vout = [CTxOut(1 * COIN, DUMMY_P2WPKH_SCRIPT)]
|
||||||
tx1a_hex = tx1a.serialize().hex()
|
tx1a_hex = tx1a.serialize().hex()
|
||||||
tx1a_txid = self.nodes[0].sendrawtransaction(tx1a_hex, 0)
|
tx1a_txid = self.nodes[0].sendrawtransaction(tx1a_hex, 0)
|
||||||
|
@ -445,7 +446,7 @@ class ReplaceByFeeTest(BitcoinTestFramework):
|
||||||
tx2a_txid = int(tx2a_txid, 16)
|
tx2a_txid = int(tx2a_txid, 16)
|
||||||
|
|
||||||
tx3a = CTransaction()
|
tx3a = CTransaction()
|
||||||
tx3a.vin = [CTxIn(COutPoint(tx1a_txid, 0), nSequence=0xffffffff),
|
tx3a.vin = [CTxIn(COutPoint(tx1a_txid, 0), nSequence=SEQUENCE_FINAL),
|
||||||
CTxIn(COutPoint(tx2a_txid, 0), nSequence=0xfffffffd)]
|
CTxIn(COutPoint(tx2a_txid, 0), nSequence=0xfffffffd)]
|
||||||
tx3a.vout = [CTxOut(int(0.9 * COIN), CScript([b'c'])), CTxOut(int(0.9 * COIN), CScript([b'd']))]
|
tx3a.vout = [CTxOut(int(0.9 * COIN), CScript([b'c'])), CTxOut(int(0.9 * COIN), CScript([b'd']))]
|
||||||
tx3a_hex = tx3a.serialize().hex()
|
tx3a_hex = tx3a.serialize().hex()
|
||||||
|
@ -579,7 +580,7 @@ class ReplaceByFeeTest(BitcoinTestFramework):
|
||||||
optout_child_tx = self.wallet.send_self_transfer(
|
optout_child_tx = self.wallet.send_self_transfer(
|
||||||
from_node=self.nodes[0],
|
from_node=self.nodes[0],
|
||||||
utxo_to_spend=parent_utxo,
|
utxo_to_spend=parent_utxo,
|
||||||
sequence=0xffffffff,
|
sequence=SEQUENCE_FINAL,
|
||||||
fee_rate=Decimal('0.01'),
|
fee_rate=Decimal('0.01'),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -589,7 +590,7 @@ class ReplaceByFeeTest(BitcoinTestFramework):
|
||||||
replacement_child_tx = self.wallet.create_self_transfer(
|
replacement_child_tx = self.wallet.create_self_transfer(
|
||||||
from_node=self.nodes[0],
|
from_node=self.nodes[0],
|
||||||
utxo_to_spend=parent_utxo,
|
utxo_to_spend=parent_utxo,
|
||||||
sequence=0xffffffff,
|
sequence=SEQUENCE_FINAL,
|
||||||
fee_rate=Decimal('0.02'),
|
fee_rate=Decimal('0.02'),
|
||||||
mempool_valid=False,
|
mempool_valid=False,
|
||||||
)
|
)
|
||||||
|
@ -608,7 +609,7 @@ class ReplaceByFeeTest(BitcoinTestFramework):
|
||||||
replacement_parent_tx = self.wallet.send_self_transfer(
|
replacement_parent_tx = self.wallet.send_self_transfer(
|
||||||
from_node=self.nodes[0],
|
from_node=self.nodes[0],
|
||||||
utxo_to_spend=confirmed_utxo,
|
utxo_to_spend=confirmed_utxo,
|
||||||
sequence=0xffffffff,
|
sequence=SEQUENCE_FINAL,
|
||||||
fee_rate=Decimal('0.03'),
|
fee_rate=Decimal('0.03'),
|
||||||
)
|
)
|
||||||
# Check that child is removed and update wallet utxo state
|
# Check that child is removed and update wallet utxo state
|
||||||
|
|
|
@ -19,6 +19,7 @@ from test_framework.messages import (
|
||||||
CTxIn,
|
CTxIn,
|
||||||
CTxInWitness,
|
CTxInWitness,
|
||||||
CTxOut,
|
CTxOut,
|
||||||
|
SEQUENCE_FINAL,
|
||||||
)
|
)
|
||||||
from test_framework.script import (
|
from test_framework.script import (
|
||||||
ANNEX_TAG,
|
ANNEX_TAG,
|
||||||
|
@ -1516,7 +1517,7 @@ class TaprootTest(BitcoinTestFramework):
|
||||||
assert self.nodes[1].getblockcount() == 0
|
assert self.nodes[1].getblockcount() == 0
|
||||||
coinbase = CTransaction()
|
coinbase = CTransaction()
|
||||||
coinbase.nVersion = 1
|
coinbase.nVersion = 1
|
||||||
coinbase.vin = [CTxIn(COutPoint(0, 0xffffffff), CScript([OP_1, OP_1]), 0xffffffff)]
|
coinbase.vin = [CTxIn(COutPoint(0, 0xffffffff), CScript([OP_1, OP_1]), SEQUENCE_FINAL)]
|
||||||
coinbase.vout = [CTxOut(5000000000, CScript([OP_1]))]
|
coinbase.vout = [CTxOut(5000000000, CScript([OP_1]))]
|
||||||
coinbase.nLockTime = 0
|
coinbase.nLockTime = 0
|
||||||
coinbase.rehash()
|
coinbase.rehash()
|
||||||
|
@ -1604,7 +1605,7 @@ class TaprootTest(BitcoinTestFramework):
|
||||||
val = 42000000 * (i + 7)
|
val = 42000000 * (i + 7)
|
||||||
tx = CTransaction()
|
tx = CTransaction()
|
||||||
tx.nVersion = 1
|
tx.nVersion = 1
|
||||||
tx.vin = [CTxIn(COutPoint(lasttxid, i & 1), CScript([]), 0xffffffff)]
|
tx.vin = [CTxIn(COutPoint(lasttxid, i & 1), CScript([]), SEQUENCE_FINAL)]
|
||||||
tx.vout = [CTxOut(val, spk), CTxOut(amount - val, CScript([OP_1]))]
|
tx.vout = [CTxOut(val, spk), CTxOut(amount - val, CScript([OP_1]))]
|
||||||
if i & 1:
|
if i & 1:
|
||||||
tx.vout = list(reversed(tx.vout))
|
tx.vout = list(reversed(tx.vout))
|
||||||
|
@ -1664,7 +1665,7 @@ class TaprootTest(BitcoinTestFramework):
|
||||||
tx.vin = []
|
tx.vin = []
|
||||||
inputs = []
|
inputs = []
|
||||||
input_spks = [tap_spks[0], tap_spks[1], old_spks[0], tap_spks[2], tap_spks[5], old_spks[2], tap_spks[6], tap_spks[3], tap_spks[4]]
|
input_spks = [tap_spks[0], tap_spks[1], old_spks[0], tap_spks[2], tap_spks[5], old_spks[2], tap_spks[6], tap_spks[3], tap_spks[4]]
|
||||||
sequences = [0, 0xffffffff, 0xffffffff, 0xfffffffe, 0xfffffffe, 0, 0, 0xffffffff, 0xffffffff]
|
sequences = [0, SEQUENCE_FINAL, SEQUENCE_FINAL, 0xfffffffe, 0xfffffffe, 0, 0, SEQUENCE_FINAL, SEQUENCE_FINAL]
|
||||||
hashtypes = [SIGHASH_SINGLE, SIGHASH_SINGLE|SIGHASH_ANYONECANPAY, SIGHASH_ALL, SIGHASH_ALL, SIGHASH_DEFAULT, SIGHASH_ALL, SIGHASH_NONE, SIGHASH_NONE|SIGHASH_ANYONECANPAY, SIGHASH_ALL|SIGHASH_ANYONECANPAY]
|
hashtypes = [SIGHASH_SINGLE, SIGHASH_SINGLE|SIGHASH_ANYONECANPAY, SIGHASH_ALL, SIGHASH_ALL, SIGHASH_DEFAULT, SIGHASH_ALL, SIGHASH_NONE, SIGHASH_NONE|SIGHASH_ANYONECANPAY, SIGHASH_ALL|SIGHASH_ANYONECANPAY]
|
||||||
for i, spk in enumerate(input_spks):
|
for i, spk in enumerate(input_spks):
|
||||||
tx.vin.append(CTxIn(spend_info[spk]['prevout'], CScript(), sequences[i]))
|
tx.vin.append(CTxIn(spend_info[spk]['prevout'], CScript(), sequences[i]))
|
||||||
|
|
|
@ -17,6 +17,7 @@ from test_framework.messages import (
|
||||||
CTxOut,
|
CTxOut,
|
||||||
MAX_BLOCK_WEIGHT,
|
MAX_BLOCK_WEIGHT,
|
||||||
MAX_MONEY,
|
MAX_MONEY,
|
||||||
|
SEQUENCE_FINAL,
|
||||||
tx_from_hex,
|
tx_from_hex,
|
||||||
)
|
)
|
||||||
from test_framework.script import (
|
from test_framework.script import (
|
||||||
|
@ -100,7 +101,7 @@ class MempoolAcceptanceTest(BitcoinTestFramework):
|
||||||
coin = coins.pop() # Pick a random coin(base) to spend
|
coin = coins.pop() # Pick a random coin(base) to spend
|
||||||
output_amount = Decimal('0.025')
|
output_amount = Decimal('0.025')
|
||||||
raw_tx_final = node.signrawtransactionwithwallet(node.createrawtransaction(
|
raw_tx_final = node.signrawtransactionwithwallet(node.createrawtransaction(
|
||||||
inputs=[{'txid': coin['txid'], 'vout': coin['vout'], "sequence": 0xffffffff}], # SEQUENCE_FINAL
|
inputs=[{'txid': coin['txid'], 'vout': coin['vout'], "sequence": SEQUENCE_FINAL}],
|
||||||
outputs=[{node.getnewaddress(): output_amount}],
|
outputs=[{node.getnewaddress(): output_amount}],
|
||||||
locktime=node.getblockcount() + 2000, # Can be anything
|
locktime=node.getblockcount() + 2000, # Can be anything
|
||||||
))['hex']
|
))['hex']
|
||||||
|
|
|
@ -22,6 +22,7 @@ from .messages import (
|
||||||
CTxIn,
|
CTxIn,
|
||||||
CTxInWitness,
|
CTxInWitness,
|
||||||
CTxOut,
|
CTxOut,
|
||||||
|
SEQUENCE_FINAL,
|
||||||
hash256,
|
hash256,
|
||||||
ser_uint256,
|
ser_uint256,
|
||||||
tx_from_hex,
|
tx_from_hex,
|
||||||
|
@ -128,7 +129,7 @@ def create_coinbase(height, pubkey=None, extra_output_script=None, fees=0, nValu
|
||||||
If extra_output_script is given, make a 0-value output to that
|
If extra_output_script is given, make a 0-value output to that
|
||||||
script. This is useful to pad block weight/sigops as needed. """
|
script. This is useful to pad block weight/sigops as needed. """
|
||||||
coinbase = CTransaction()
|
coinbase = CTransaction()
|
||||||
coinbase.vin.append(CTxIn(COutPoint(0, 0xffffffff), script_BIP34_coinbase_height(height), 0xffffffff))
|
coinbase.vin.append(CTxIn(COutPoint(0, 0xffffffff), script_BIP34_coinbase_height(height), SEQUENCE_FINAL))
|
||||||
coinbaseoutput = CTxOut()
|
coinbaseoutput = CTxOut()
|
||||||
coinbaseoutput.nValue = nValue * COIN
|
coinbaseoutput.nValue = nValue * COIN
|
||||||
if nValue == 50:
|
if nValue == 50:
|
||||||
|
@ -156,7 +157,7 @@ def create_tx_with_script(prevtx, n, script_sig=b"", *, amount, script_pub_key=C
|
||||||
"""
|
"""
|
||||||
tx = CTransaction()
|
tx = CTransaction()
|
||||||
assert n < len(prevtx.vout)
|
assert n < len(prevtx.vout)
|
||||||
tx.vin.append(CTxIn(COutPoint(prevtx.sha256, n), script_sig, 0xffffffff))
|
tx.vin.append(CTxIn(COutPoint(prevtx.sha256, n), script_sig, SEQUENCE_FINAL))
|
||||||
tx.vout.append(CTxOut(amount, script_pub_key))
|
tx.vout.append(CTxOut(amount, script_pub_key))
|
||||||
tx.calc_sha256()
|
tx.calc_sha256()
|
||||||
return tx
|
return tx
|
||||||
|
|
|
@ -40,6 +40,7 @@ COIN = 100000000 # 1 btc in satoshis
|
||||||
MAX_MONEY = 21000000 * COIN
|
MAX_MONEY = 21000000 * COIN
|
||||||
|
|
||||||
BIP125_SEQUENCE_NUMBER = 0xfffffffd # Sequence number that is rbf-opt-in (BIP 125) and csv-opt-out (BIP 68)
|
BIP125_SEQUENCE_NUMBER = 0xfffffffd # Sequence number that is rbf-opt-in (BIP 125) and csv-opt-out (BIP 68)
|
||||||
|
SEQUENCE_FINAL = 0xffffffff # Sequence number that disables nLockTime if set for every input of a tx
|
||||||
|
|
||||||
MAX_PROTOCOL_MESSAGE_LENGTH = 4000000 # Maximum length of incoming protocol messages
|
MAX_PROTOCOL_MESSAGE_LENGTH = 4000000 # Maximum length of incoming protocol messages
|
||||||
MAX_HEADERS_RESULTS = 2000 # Number of headers sent in one getheaders result
|
MAX_HEADERS_RESULTS = 2000 # Number of headers sent in one getheaders result
|
||||||
|
|
Loading…
Add table
Reference in a new issue