Thanks. Have tried it, but the v0.15.2 node doesn’t expand its chain with submitted blocks. Interestingly, in its blockchaininfo the header count gets increased while block count remains at 0. The other node, v0.16.3 is working fine. Here my variant of dumb_sync_blocks
0def dumb_sync_blocks(self):
1 node_from = self.nodes[0]
2 to_height = node_from.getblockheader(node_from.getbestblockhash())['height']
3 for n in range(1, len(self.nodes)):
4 height = self.nodes[n].getblockheader(self.nodes[n].getbestblockhash())['height']
5 for i in range(height, to_height+1):
6 b = node_from.getblock(blockhash=node_from.getblockhash(i), verbose=0)
7 self.nodes[n].submitblock(b)
8 new_height = self.nodes[n].getblockheader(self.nodes[n].getbestblockhash())['height']
9 print("node: {}, new best height: {}".format(n, new_height))
The output is like this:
0node: 1, new best height: 101
1node: 2, new best height: 0
Here their respective blockchaininfo jsons:
v0.16.3
0{
1'chain': 'regtest',
2'blocks': 101,
3'headers': 101,
4'bestblockhash': '1a2f4021b111f20b12071bb68c92dc0037a2237ae034b345b002971dbb9f5e16', }
v0.15.2
0{
1'chain': 'regtest',
2'blocks': 0,
3'headers': 101,
4'bestblockhash': '0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206' }
In the test code I am sending some coins to both wallets and then calling dumb_sync_blocks to update all chains.
0node_master.generatetoaddress(101, v16_3_address)
1self.dumb_sync_blocks()