Changeset View
Changeset View
Standalone View
Standalone View
test/functional/p2p_compactblocks.py
Show First 20 Lines • Show All 311 Lines • ▼ Show 20 Lines | class CompactBlocksTest(BitcoinTestFramework): | ||||
# bitcoind's choice of nonce. | # bitcoind's choice of nonce. | ||||
def test_compactblock_construction(self, node, test_node): | def test_compactblock_construction(self, node, test_node): | ||||
# Generate a bunch of transactions. | # Generate a bunch of transactions. | ||||
node.generate(101) | node.generate(101) | ||||
num_transactions = 25 | num_transactions = 25 | ||||
address = node.getnewaddress() | address = node.getnewaddress() | ||||
for i in range(num_transactions): | for i in range(num_transactions): | ||||
txid = node.sendtoaddress(address, 0.1) | txid = node.sendtoaddress(address, 100000) | ||||
hex_tx = node.gettransaction(txid)["hex"] | hex_tx = node.gettransaction(txid)["hex"] | ||||
tx = FromHex(CTransaction(), hex_tx) | tx = FromHex(CTransaction(), hex_tx) | ||||
# Wait until we've seen the block announcement for the resulting tip | # Wait until we've seen the block announcement for the resulting tip | ||||
tip = int(node.getbestblockhash(), 16) | tip = int(node.getbestblockhash(), 16) | ||||
test_node.wait_for_block_announcement(tip) | test_node.wait_for_block_announcement(tip) | ||||
# Make sure we will receive a fast-announce compact block | # Make sure we will receive a fast-announce compact block | ||||
▲ Show 20 Lines • Show All 603 Lines • Show Last 20 Lines |