add receive_from_unbroadcasted_transfer_to_blinded test #22
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The test added in this PR shows what I consider a bug:
a wallet could (maliciously) accept a transfer sending to a blinded UTXO even if the transfer TX has not been broadcasted and then send the assets to another wallet (in the test,
wlt_3
) which will think the received allocation is valid and owned. The receiver will notice this allocation is not spendable only when it actually tries to spend it. I think the wallet should be able to differentiate an allocation coming from a history containing an unbroadcasted/unmined TX.Run
cargo test --test transfers receive_from_unbroadcasted_transfer_to_blinded -- --nocapture
to see the issue.To be merged once we have a fix for this.