mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
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:
parent
9bf09324df
commit
2656302c60
@ -232,6 +232,7 @@ class App(BaseApplication):
|
|||||||
# register a new block only when new transactions are received
|
# register a new block only when new transactions are received
|
||||||
if self.block_txn_ids:
|
if self.block_txn_ids:
|
||||||
self.bigchaindb.store_bulk_transactions(self.block_transactions)
|
self.bigchaindb.store_bulk_transactions(self.block_transactions)
|
||||||
|
|
||||||
block = Block(app_hash=self.block_txn_hash,
|
block = Block(app_hash=self.block_txn_hash,
|
||||||
height=self.new_height,
|
height=self.new_height,
|
||||||
transactions=self.block_txn_ids)
|
transactions=self.block_txn_ids)
|
||||||
|
@ -101,7 +101,7 @@ def test_app(b, init_chain_request):
|
|||||||
|
|
||||||
block0 = b.get_latest_block()
|
block0 = b.get_latest_block()
|
||||||
assert block0
|
assert block0
|
||||||
assert block0['height'] == 1
|
assert block0['height'] == 2
|
||||||
|
|
||||||
# when empty block is generated hash of previous block should be returned
|
# when empty block is generated hash of previous block should be returned
|
||||||
assert block0['app_hash'] == new_block_hash
|
assert block0['app_hash'] == new_block_hash
|
||||||
|
Loading…
x
Reference in New Issue
Block a user