Inside Bitcoin
Opening the selected file…
Inside Bitcoin
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
751self.log.info("Test getblock when block data is available but undo data isn't")752# Submits a block building on the header-only block, so it can't be connected and has no undo data753tx = create_tx_with_script(block.vtx[0], 0, script_sig=bytes([OP_TRUE]), amount=50 * COIN)754block_noundo = create_block(block.hash_int, create_coinbase(current_height + 2, nValue=100), ntime=block_time + 1, txlist=[tx])755block_noundo.solve()756node.submitblock(block_noundo.serialize().hex())758assert_fee_not_in_block(block_noundo.hash_hex, 2)759assert_fee_not_in_block(block_noundo.hash_hex, 3)760assert_vin_does_not_contain_prevout(block_noundo.hash_hex, 2)761assert_vin_does_not_contain_prevout(block_noundo.hash_hex, 3)763self.log.info("Test getblock when block is missing")764move_block_file('blk00000.dat', 'blk00000.dat.bak')765assert_raises_rpc_error(-1, "Block not found on disk", node.getblock, blockhash)766move_block_file('blk00000.dat.bak', 'blk00000.dat')769if __name__ == '__main__':770BlockchainTest(__file__).main()
Independent explanations by MyBitcoinExplorer. Not affiliated with or endorsed by Bitcoin Core. Guides are educational and do not replace the source or its tests.
Bitcoin Core source © its contributors, distributed under the MIT license. Original notices and bundled third-party licenses are retained in the source tree.