mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-23 21:39:13 +02:00
Merge #16325: rpc: Clarify that block count means height excl genesis
fab0c820farpc: Clarify that block count means height excl genesis (MarcoFalke) Pull request description: There is a common misconception that the block count returned by the blockchain rpcs includes the genesis block. See for example the discussion in https://github.com/bitcoin/bitcoin/pull/16292#issuecomment-506303256. However, it really returns the height, which is `0` for the genesis block. So clarify that and also remove the misleading "longest blockchain" comment. Finally, fix the wallet test that incorrectly used this rpc. ACKs for top commit: instagibbs: utACKfab0c820fapromag: ACKfab0c82, sorry for the misconception. Tree-SHA512: 0d087cbb628d3866352bca6420402f392e6a997e579941701a408a7fca355d84645045661f39b022e4479cc07f85a6cddaa9095b6fd9911b245692482420a5e4
This commit is contained in:
@@ -57,8 +57,7 @@ class ResendWalletTransactionsTest(BitcoinTestFramework):
|
||||
# after the last time we tried to broadcast. Use mocktime and give an extra minute to be sure.
|
||||
block_time = int(time.time()) + 6 * 60
|
||||
node.setmocktime(block_time)
|
||||
block = create_block(int(node.getbestblockhash(), 16), create_coinbase(node.getblockchaininfo()['blocks']), block_time)
|
||||
block.nVersion = 3
|
||||
block = create_block(int(node.getbestblockhash(), 16), create_coinbase(node.getblockcount() + 1), block_time)
|
||||
block.rehash()
|
||||
block.solve()
|
||||
node.submitblock(ToHex(block))
|
||||
|
||||
Reference in New Issue
Block a user