Changeset View
Changeset View
Standalone View
Standalone View
test/functional/abc-mempool-accept-txn.py
Show First 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
self.test.add_all_connections(self.nodes) | self.test.add_all_connections(self.nodes) | ||||
# Start up network handling in another thread | # Start up network handling in another thread | ||||
NetworkThread().start() | NetworkThread().start() | ||||
self.test.run() | self.test.run() | ||||
def add_transactions_to_block(self, block, tx_list): | def add_transactions_to_block(self, block, tx_list): | ||||
[tx.rehash() for tx in tx_list] | [tx.rehash() for tx in tx_list] | ||||
block.vtx.extend(tx_list) | block.vtx.extend(tx_list) | ||||
block.vtx = [block.vtx[0]] + \ | |||||
sorted(block.vtx[1:], key=lambda tx: tx.get_id()) | |||||
# this is a little handier to use than the version in blocktools.py | # this is a little handier to use than the version in blocktools.py | ||||
def create_tx(self, spend_tx, n, value, script=CScript([OP_TRUE])): | def create_tx(self, spend_tx, n, value, script=CScript([OP_TRUE])): | ||||
tx = create_transaction(spend_tx, n, b"", value, script) | tx = create_transaction(spend_tx, n, b"", value, script) | ||||
return tx | return tx | ||||
# sign a transaction, using the key we know about | # sign a transaction, using the key we know about | ||||
# this signs input 0 in tx, which is assumed to be spending output n in | # this signs input 0 in tx, which is assumed to be spending output n in | ||||
▲ Show 20 Lines • Show All 187 Lines • Show Last 20 Lines |