Skip to content

Commit d2faa04

Browse files
committed
BUG: fix SSPKM::GetCredit counting externally sent notes
Thus making the GUI display a balance higher than it should.
1 parent 6b458ae commit d2faa04

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/sapling/saplingscriptpubkeyman.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,9 @@ CAmount SaplingScriptPubKeyMan::GetCredit(const CWalletTx& tx, const isminefilte
644644
// Obtain the noteData and check if the nullifier has being spent or not
645645
SaplingNoteData noteData = tx.mapSaplingNoteData.at(op);
646646

647+
// Skip externally sent notes
648+
if (!noteData.IsMyNote()) continue;
649+
647650
// The nullifier could be null if the wallet was locked when the noteData was created.
648651
if (noteData.nullifier &&
649652
(fUnspent && IsSaplingSpent(*noteData.nullifier))) {

0 commit comments

Comments
 (0)