Skip to content

Commit 2ae1788

Browse files
committed
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
1 parent 458720e commit 2ae1788

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/wallet/scriptpubkeyman.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2852,6 +2852,11 @@ bool DescriptorScriptPubKeyMan::CanUpdateToWalletDescriptor(const WalletDescript
28522852
return false;
28532853
}
28542854

2855+
if (!descriptor.descriptor->IsRange()) {
2856+
// Skip range check for non-range descriptors
2857+
return true;
2858+
}
2859+
28552860
if (descriptor.range_start > m_wallet_descriptor.range_start ||
28562861
descriptor.range_end < m_wallet_descriptor.range_end) {
28572862
// Use inclusive range for error

0 commit comments

Comments
 (0)