cormorant: fix scan date of nested wallet import

This commit is contained in:
Craig Raw 2022-12-12 10:09:22 +02:00
parent 3f3cdca94f
commit 00f5001385

View file

@ -169,7 +169,7 @@ public class BitcoindClient {
if(childWallet.isNested()) { if(childWallet.isNested()) {
for(KeyPurpose keyPurpose : KeyPurpose.DEFAULT_PURPOSES) { for(KeyPurpose keyPurpose : KeyPurpose.DEFAULT_PURPOSES) {
for(WalletNode addressNode : childWallet.getNode(keyPurpose).getChildren()) { for(WalletNode addressNode : childWallet.getNode(keyPurpose).getChildren()) {
outputDescriptors.put(OutputDescriptor.normalize(OutputDescriptor.toDescriptorString(addressNode.getAddress())), getScanDate(wallet, null)); outputDescriptors.put(OutputDescriptor.normalize(OutputDescriptor.toDescriptorString(addressNode.getAddress())), getScanDate(childWallet, null));
} }
} }
} }
@ -200,7 +200,7 @@ public class BitcoindClient {
forceRescan = true; forceRescan = true;
} }
return new ScanDate(wallet.getBirthDate(), range, forceRescan); return new ScanDate(wallet.getBirthDate() == null && !wallet.isMasterWallet() ? wallet.getMasterWallet().getBirthDate() : wallet.getBirthDate(), range, forceRescan);
} }
private void importDescriptors(Map<String, ScanDate> descriptors) { private void importDescriptors(Map<String, ScanDate> descriptors) {