bd46491d07
In this commit, we fix an existing bug that would cause us to be unable to derive the very first key in a key family if the wallet hadn't already derived it in the past. This can happen if a user keeps their same `channel.db`, but restores their wallet resulting in fresh `wallet.db` state. This is an existing issue due to the fact that we don't properly distinguish between an empty key locator, and the very first key in a `KeyFamily`: `(0, 0)`. Atm, `KeyLoactor{0, 0}.IsEmpty() == True`, causing us to be unable to retrieve this key in certain cases since we fall through and attempt address based derivation. In order to remedy this, we add a new special case (until we upgrade `KeyLoactor` formats, but needed for legacy reasons) to _try_ a regular `KeyLoactor` based derivation if we fail to derive via address, and this is an "empty" key loc. This has been tested in the field and shown to work, with the one downside that in this "hot swap restoration" case, we'll hit the database twice to derive the key. |
||
---|---|---|
.. | ||
blockchain.go | ||
btcwallet.go | ||
config.go | ||
driver.go | ||
signer.go |