Track file contract transactions in wallet
See discussion below.
Unfortunately this will require users to rescan. We could do the rescan automatically on first start-up, or instruct users how to do it themselves.
Merge request reports
Activity
assigned to @ChrisSchinnerl
Does this mean that in the error case we're just going to ignore certain outputs? That doesn't seem like the best solution either.
You think the issue stems from really old wallets that upgraded to a more recent wallet? That should be something we are able to reproduce I think, and indicates that one of our upgrade processes is incomplete.
- Resolved by David Vorick
Could it be that sine we never delete from
bucketAddrTransaction
but we do delete frombucketProcessedTransactions
when we reorg, that the second call fails due to transactions being in one bucket but not the other? @lukechampine @DavidVorick
assigned to @lukechampine
I've identified the root cause: file contracts.
The wallet builds its list of spendable outputs by iterating through the
SiacoinOutputDiffs
in each consensus change. If the output'sUnlockHash
belongs to the wallet, it gets added to the spendable set. This includesValidPayouts
orMissedPayouts
from file contracts.However, when adding transactions to the db, the
ValidPayouts
andMissedPayouts
fields of file contracts are not added to theProcessedTransaction
. So whenUnspentOutputs
tries to lookup transactions relevant to an output that came from a file contract, it draws a blank.What's the proper solution to this? I think the most straightforward approach would be to add the
ValidPayouts
andMissedPayouts
to theProcessedTransaction
, using the contract'sEndHeight+WindowSize
as the maturity height. One complication here is that we don't actually know whether it's the valid payout or the missed payout that was created; we'd need to cross-reference with the resultingSiacoinOutputDiff
. But regardless,UnspentOutputs
would then be able to report the properConfirmationHeight
of file contract outputs.assigned to @DavidVorick
added 36 commits
-
28232921...a98b398a - 35 commits from branch
master
- 791ac59f - track file contract transactions in wallet
-
28232921...a98b398a - 35 commits from branch
changed milestone to %v1.4.0
assigned to @lukechampine
assigned to @DavidVorick