mirror of
https://github.com/mimblewimble/grin.git
synced 2025-01-21 03:21:08 +03:00
Refresh coinbase key if the existing one was removed (#2493)
* Refresh coinbase key if the existing was removed It happens if `wallet check` runs in parallel. Alternative solution is not to remove it during the check. Fixes #2412
This commit is contained in:
parent
0c851c5140
commit
062d41766e
2 changed files with 5 additions and 2 deletions
|
@ -104,7 +104,7 @@ pub enum ErrorKind {
|
||||||
CallbackImpl(&'static str),
|
CallbackImpl(&'static str),
|
||||||
|
|
||||||
/// Wallet backend error
|
/// Wallet backend error
|
||||||
#[fail(display = "Wallet store error")]
|
#[fail(display = "Wallet store error: {}", _0)]
|
||||||
Backend(String),
|
Backend(String),
|
||||||
|
|
||||||
/// Callback implementation error conversion
|
/// Callback implementation error conversion
|
||||||
|
|
|
@ -473,7 +473,10 @@ where
|
||||||
let parent_key_id = wallet.parent_key_id();
|
let parent_key_id = wallet.parent_key_id();
|
||||||
|
|
||||||
let key_id = match key_id {
|
let key_id = match key_id {
|
||||||
Some(key_id) => keys::retrieve_existing_key(wallet, key_id, None)?.0,
|
Some(key_id) => match keys::retrieve_existing_key(wallet, key_id, None) {
|
||||||
|
Ok(k) => k.0,
|
||||||
|
Err(_) => keys::next_available_key(wallet)?,
|
||||||
|
},
|
||||||
None => keys::next_available_key(wallet)?,
|
None => keys::next_available_key(wallet)?,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue