Skip to content

Commit 1c4c634

Browse files
committed
Fix watchonly status showing 0 transactions
1 parent 7e90fcf commit 1c4c634

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/veil/ringct/rpcanonwallet.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2485,6 +2485,13 @@ static UniValue getwatchonlystatus(const JSONRPCRequest &request)
24852485

24862486
int current_count = 0;
24872487
if (GetWatchOnlyKeyCount(sxAddr.scan_secret, current_count)) {
2488+
// Handle legacy bug: first tx may be at index 0 with count stored as 0
2489+
if (current_count == 0) {
2490+
CWatchOnlyTx checkTx;
2491+
if (ReadWatchOnlyTransaction(sxAddr.scan_secret, 0, checkTx)) {
2492+
current_count = 1;
2493+
}
2494+
}
24882495
result.pushKV("transactions_found", current_count);
24892496
}
24902497

0 commit comments

Comments
 (0)