Filter returned Orchard notes by minimum confirmations.
This commit is contained in:
parent
f9380572c1
commit
bd50fbbb94
|
@ -174,8 +174,7 @@ class WalletAccountsTest(BitcoinTestFramework):
|
|||
# visible with minconf=0.
|
||||
self.sync_all()
|
||||
self.check_balance(0, 0, ua0, {'sapling': 9})
|
||||
# TODO: Uncomment once CWallet::FindSpendableInputs returns Orchard notes.
|
||||
#self.check_balance(0, 0, ua0, {'sapling': 9, 'orchard': 10}, 0)
|
||||
self.check_balance(0, 0, ua0, {'sapling': 9, 'orchard': 10}, 0)
|
||||
|
||||
self.nodes[2].generate(1)
|
||||
self.sync_all()
|
||||
|
|
|
@ -1978,14 +1978,15 @@ SpendableInputs CWallet::FindSpendableInputs(
|
|||
}, selector.GetPattern());
|
||||
|
||||
for (const auto& ivk : orchardIvks) {
|
||||
// TODO ORCHARD: Allow the minimum number of confirmations
|
||||
// to be specified
|
||||
std::vector<OrchardNoteMetadata> incomingNotes;
|
||||
orchardWallet.GetFilteredNotes(incomingNotes, ivk, true, true, true);
|
||||
unspent.orchardNoteMetadata.insert(
|
||||
unspent.orchardNoteMetadata.begin(),
|
||||
incomingNotes.begin(),
|
||||
incomingNotes.end());
|
||||
|
||||
for (const auto& noteMeta : incomingNotes) {
|
||||
auto mit = mapWallet.find(noteMeta.GetOutPoint().hash);
|
||||
if (mit != mapWallet.end() && mit->second.GetDepthInMainChain() >= minDepth) {
|
||||
unspent.orchardNoteMetadata.push_back(noteMeta);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return unspent;
|
||||
|
|
Loading…
Reference in New Issue