mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-25 15:05:55 +01:00
Merge #20266: wallet: fix change detection of imported internal descriptors
bd93fc9945Fix change detection of imported internal descriptors (Andrew Chow) Pull request description: Import internal descriptors were having address book entries added which meant they would be detected as non-change. Fix this and add a test for it. ACKs for top commit: laanwj: Code review ACKbd93fc9945meshcollider: utACKbd93fc9945promag: Code review ACKbd93fc9945. Tree-SHA512: 8fa9e364be317627ec171eedffdb505976c0e7f1e55bc7e8cfdffa3aeea5db24d231f55166602cd0e97a5ba621acc871de0a765c75d0c65678f83e93c3b657c5
This commit is contained in:
@@ -4511,7 +4511,7 @@ DescriptorScriptPubKeyMan* CWallet::GetDescriptorScriptPubKeyMan(const WalletDes
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ScriptPubKeyMan* CWallet::AddWalletDescriptor(WalletDescriptor& desc, const FlatSigningProvider& signing_provider, const std::string& label)
|
||||
ScriptPubKeyMan* CWallet::AddWalletDescriptor(WalletDescriptor& desc, const FlatSigningProvider& signing_provider, const std::string& label, bool internal)
|
||||
{
|
||||
if (!IsWalletFlagSet(WALLET_FLAG_DESCRIPTORS)) {
|
||||
WalletLogPrintf("Cannot add WalletDescriptor to a non-descriptor wallet\n");
|
||||
@@ -4568,7 +4568,7 @@ ScriptPubKeyMan* CWallet::AddWalletDescriptor(WalletDescriptor& desc, const Flat
|
||||
}
|
||||
|
||||
CTxDestination dest;
|
||||
if (ExtractDestination(script_pub_keys.at(0), dest)) {
|
||||
if (!internal && ExtractDestination(script_pub_keys.at(0), dest)) {
|
||||
SetAddressBook(dest, label, "receive");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user