Skip to content

Commit

Permalink
getblockchaininfo: remove incorrect fields 'signblock_asm' and 'signb…
Browse files Browse the repository at this point in the history
…lock_hex' from rpc response
  • Loading branch information
James Dorfman committed Apr 28, 2022
1 parent 80862ff commit efdb2f4
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 11 deletions.
4 changes: 1 addition & 3 deletions src/rpc/blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1444,10 +1444,8 @@ RPCHelpMan getblockchaininfo()
obj.pushKV("size_on_disk", CalculateCurrentUsage());
obj.pushKV("pruned", fPruneMode);
if (g_signed_blocks) {
CScript sign_block_script = chainparams.GetConsensus().signblockscript;
obj.pushKV("signblock_asm", ScriptToAsmStr(sign_block_script));
obj.pushKV("signblock_hex", HexStr(sign_block_script));
if (!IsDynaFedEnabled(::ChainActive().Tip(), chainparams.GetConsensus())) {
CScript sign_block_script = chainparams.GetConsensus().signblockscript;
obj.pushKV("current_signblock_asm", ScriptToAsmStr(sign_block_script));
obj.pushKV("current_signblock_hex", HexStr(sign_block_script));
obj.pushKV("max_block_witness", (uint64_t)chainparams.GetConsensus().max_block_signature_size);
Expand Down
5 changes: 0 additions & 5 deletions test/functional/feature_blocksign.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ def mine_block(self, make_transactions):
if is_dyna:
wsh_wrap = self.nodes[0].decodescript(self.witnessScript)['segwit']['hex']
assert_equal(wsh_wrap, blockchain_info['current_signblock_hex'])
assert blockchain_info['current_signblock_hex'] != blockchain_info['signblock_hex']

# Make a few transactions to make non-empty blocks for compact transmission
if make_transactions:
Expand Down Expand Up @@ -207,10 +206,6 @@ def run_test(self):
assert 'signblock_witness_asm' in block
assert 'signblock_witness_hex' in block

signblockscript = make_signblockscript(self.num_keys, self.required_signers, self.keys)
assert_equal(info['signblock_asm'], self.nodes[0].decodescript(signblockscript)['asm'])
assert_equal(info['signblock_hex'], signblockscript)

assert_equal(info['softforks']['dynafed']['bip9']['status'], "defined")

# Next let's activate dynafed
Expand Down
1 change: 0 additions & 1 deletion test/functional/feature_dynafed.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ def test_legacy_params(self):

# blocksigner is OP_TRUE, extension space is hardcoded one in chainparams
signblock_info = self.nodes[i].getblockchaininfo()
assert_equal(signblock_info["signblock_hex"], "51")
assert_equal(signblock_info["current_signblock_hex"], "51")
assert_equal(signblock_info["max_block_witness"], 74)
assert_equal(signblock_info["extension_space"], initial_extension)
Expand Down
2 changes: 0 additions & 2 deletions test/functional/rpc_blockchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ def _test_getblockchaininfo(self):
'max_block_witness',
'mediantime',
'pruned',
'signblock_asm',
'signblock_hex',
'size_on_disk',
'softforks',
'verificationprogress',
Expand Down

0 comments on commit efdb2f4

Please sign in to comment.