Fix a bookkeeping error on watching wallet exports.
The exported watching wallet would include all imported addresses' chain indexes added to the chain index map. Imported addresses are special as they do not belong to the address chain, and this would cause issues when serializing the wallet.
This commit is contained in:
parent
04b51ee426
commit
e8c8823bfe
1 changed files with 3 additions and 1 deletions
|
@ -1303,7 +1303,9 @@ func (w *Wallet) ExportWatchingWallet() (*Wallet, error) {
|
|||
}
|
||||
for apkh, addr := range w.addrMap {
|
||||
apkhCopy := apkh
|
||||
ww.chainIdxMap[addr.chainIndex] = &apkhCopy
|
||||
if addr.chainIndex != importedKeyChainIdx {
|
||||
ww.chainIdxMap[addr.chainIndex] = &apkhCopy
|
||||
}
|
||||
ww.addrMap[apkhCopy] = addr.watchingCopy()
|
||||
}
|
||||
for apkh, cmt := range w.addrCommentMap {
|
||||
|
|
Loading…
Add table
Reference in a new issue