mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-17 13:07:54 +02:00
getblockchaininfo: add trim_headers field
This commit is contained in:
parent
4171939b58
commit
eed85dc5df
3 changed files with 6 additions and 1 deletions
|
|
@ -1741,6 +1741,7 @@ RPCHelpMan getblockchaininfo()
|
|||
}
|
||||
obj.pushKV("size_on_disk", chainman.m_blockman.CalculateCurrentUsage());
|
||||
obj.pushKV("pruned", node::fPruneMode);
|
||||
obj.pushKV("trim_headers", node::fTrimHeaders); // ELEMENTS
|
||||
if (g_signed_blocks) {
|
||||
if (!DeploymentActiveAfter(tip, chainparams.GetConsensus(), Consensus::DEPLOYMENT_DYNA_FED)) {
|
||||
CScript sign_block_script = chainparams.GetConsensus().signblockscript;
|
||||
|
|
|
|||
|
|
@ -187,6 +187,10 @@ class TrimHeadersTest(BitcoinTestFramework):
|
|||
self.mine_blocks(101, False)
|
||||
self.sync_all()
|
||||
self.check_height(expected_height, all=True)
|
||||
# check the new field in getblockchaininfo
|
||||
assert not self.nodes[0].getblockchaininfo()["trim_headers"]
|
||||
assert self.nodes[1].getblockchaininfo()["trim_headers"]
|
||||
assert self.nodes[2].getblockchaininfo()["trim_headers"]
|
||||
|
||||
self.log.info("Shut down trimmed nodes")
|
||||
self.stop_node(1)
|
||||
|
|
@ -201,7 +205,6 @@ class TrimHeadersTest(BitcoinTestFramework):
|
|||
tip = self.nodes[0].getblockhash(self.nodes[0].getblockcount())
|
||||
header = self.nodes[0].getblockheader(tip)
|
||||
block = self.nodes[0].getblock(tip)
|
||||
info = self.nodes[0].getblockchaininfo()
|
||||
|
||||
assert 'signblock_witness_asm' in header
|
||||
assert 'signblock_witness_hex' in header
|
||||
|
|
|
|||
|
|
@ -123,6 +123,7 @@ class BlockchainTest(BitcoinTestFramework):
|
|||
'pruned',
|
||||
'size_on_disk',
|
||||
'time',
|
||||
'trim_headers',
|
||||
'verificationprogress',
|
||||
'warnings',
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue