From f2944fd33b3d945d6db60ed78267631ed0f4de3c Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Wed, 26 Jun 2019 03:54:44 -0300 Subject: [PATCH] if no headers, best block hash is genesis --- lbry/lbry/wallet/manager.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lbry/lbry/wallet/manager.py b/lbry/lbry/wallet/manager.py index f67e245d4..5a45b7021 100644 --- a/lbry/lbry/wallet/manager.py +++ b/lbry/lbry/wallet/manager.py @@ -184,6 +184,8 @@ class LbryWalletManager(BaseWalletManager): len(set(receiving_addresses).difference(set(migrated_receiving)))) def get_best_blockhash(self): + if len(self.ledger.headers) <= 0: + return self.ledger.genesis_hash return self.ledger.headers.hash(self.ledger.headers.height).decode() def get_unused_address(self):