mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
getblockchaininfo: make bip9_softforks an object, not an array.
We can't change "softforks", but it seems far more logical to use tags in an object rather than using an "id" field in an array. For example, to get the csv status before, you need to iterate the array to find the entry with 'id' field equal to "csv": jq '.bip9_softforks | map(select(.id == "csv"))[] | .status' Now: jq '.bip9_softforks.csv.status' There is no issue with fork names being incompatible with JSON tags, since we're selecting them ourselves. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -548,7 +548,4 @@ def create_lots_of_big_transactions(node, txouts, utxos, fee):
|
||||
|
||||
def get_bip9_status(node, key):
|
||||
info = node.getblockchaininfo()
|
||||
for row in info['bip9_softforks']:
|
||||
if row['id'] == key:
|
||||
return row
|
||||
raise IndexError ('key:"%s" not found' % key)
|
||||
return info['bip9_softforks'][key]
|
||||
|
||||
Reference in New Issue
Block a user