mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 14:59:39 -04:00
Skip range verification for non-ranged desc
Non-range desc are always added to the wallet with the range [0,0]. After the descriptor is added, the wallet will TopUp the keypool. For non-range descriptors, this process updates the desc range to [0,1]. Any attempts to update this non-range descriptor with a [0,0] range will result in an error because the range checks rejects new ranges not included in the old range. Since this is a non-range desc, the range information should be disregarded and AddWalletDescriptor should always succeed regardless of provided range information
This commit is contained in:
parent
458720e5e9
commit
2ae1788dd4
1 changed files with 5 additions and 0 deletions
|
@ -2852,6 +2852,11 @@ bool DescriptorScriptPubKeyMan::CanUpdateToWalletDescriptor(const WalletDescript
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!descriptor.descriptor->IsRange()) {
|
||||||
|
// Skip range check for non-range descriptors
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (descriptor.range_start > m_wallet_descriptor.range_start ||
|
if (descriptor.range_start > m_wallet_descriptor.range_start ||
|
||||||
descriptor.range_end < m_wallet_descriptor.range_end) {
|
descriptor.range_end < m_wallet_descriptor.range_end) {
|
||||||
// Use inclusive range for error
|
// Use inclusive range for error
|
||||||
|
|
Loading…
Add table
Reference in a new issue