Problem: Bigchaindb crashes when restarted after init chain (#2519)

Solution: Return appropirate height so that Tendermint doesn't execute
init_chain more than once
This commit is contained in:
Vanshdeep Singh 2018-09-06 11:27:52 +02:00 committed by Muawia Khan
parent 9bf09324df
commit 2656302c60
2 changed files with 8 additions and 7 deletions

View File

@ -232,6 +232,7 @@ class App(BaseApplication):
# register a new block only when new transactions are received
if self.block_txn_ids:
self.bigchaindb.store_bulk_transactions(self.block_transactions)
block = Block(app_hash=self.block_txn_hash,
height=self.new_height,
transactions=self.block_txn_ids)

View File

@ -101,7 +101,7 @@ def test_app(b, init_chain_request):
block0 = b.get_latest_block()
assert block0
assert block0['height'] == 1
assert block0['height'] == 2
# when empty block is generated hash of previous block should be returned
assert block0['app_hash'] == new_block_hash