mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 23:03:45 +01:00
Merge bitcoin/bitcoin#32344: Wallet: Fix Non-Ranged Descriptors with Range [0,0] Trigger Unexpected Wallet Errors in AddWalletDescriptor
97d383af6dTest updating non-ranged descriptor with [0,0] range succeeds (Novo)2ae1788dd4Skip range verification for non-ranged desc (Novo) Pull request description: Closes https://github.com/bitcoin/bitcoin/issues/31728 This PR updates the `DescriptorScriptPubKeyMan` to skip range checks for non-ranged descriptors, which previously caused errors when updating a non-ranged descriptor with the range [0,0] #### Testing A unit test was added to test the new behaviour ACKs for top commit: achow101: ACK97d383af6drkrux: ACK97d383aTree-SHA512: 6dbd058376d9e57d26477d9d6d89646e80a32e3ffcc9f4e30eeda273575d12583ce520cc0032cc67c12ea0b3ad344fbd3945d9fc5e389b6a6bce1ea7ad5d6e59
This commit is contained in:
@@ -1598,6 +1598,11 @@ bool DescriptorScriptPubKeyMan::CanUpdateToWalletDescriptor(const WalletDescript
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!descriptor.descriptor->IsRange()) {
|
||||
// Skip range check for non-range descriptors
|
||||
return true;
|
||||
}
|
||||
|
||||
if (descriptor.range_start > m_wallet_descriptor.range_start ||
|
||||
descriptor.range_end < m_wallet_descriptor.range_end) {
|
||||
// Use inclusive range for error
|
||||
|
||||
Reference in New Issue
Block a user