Write imported multisig addresses to disk.
When the addmultisigaddress RPC was called, the wallet with the imported address was not being written to disk, and if no more writes were scheduled, the address could be lost. This change immediately writes the updated keystore to disk before the RPC returns. Closes #98.
This commit is contained in:
parent
ff7ecf5e54
commit
770384be12
1 changed files with 6 additions and 0 deletions
|
@ -1140,6 +1140,12 @@ func AddMultiSigAddress(icmd btcjson.Cmd) (interface{}, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
// Write wallet with imported multisig address to disk.
|
||||
AcctMgr.ds.ScheduleWalletWrite(acct)
|
||||
if err := AcctMgr.ds.FlushAccount(acct); err != nil {
|
||||
return nil, fmt.Errorf("account write failed: %v", err)
|
||||
}
|
||||
|
||||
// Associate the import address with this account.
|
||||
AcctMgr.MarkAddressForAccount(address, acct)
|
||||
|
||||
|
|
Loading…
Reference in a new issue