Implement input/output ownership receiver state checks#7
Merged
arminsabouri merged 1 commit intopayjoin:payjoin-v4from Jul 24, 2025
Merged
Conversation
4c1dc76 to
b0a1463
Compare
lianad/src/payjoin/receiver.rs
Outdated
Comment on lines
113
to
115
| .check_no_inputs_seen_before(|outpoint| { | ||
| let seen = db_conn | ||
| .coins_by_outpoints(&[*outpoint]) | ||
| .contains_key(outpoint); |
Collaborator
There was a problem hiding this comment.
For this check we may need to setup another table. i.e save the outpoints for a proposal after this check. And then refrence that table in this closure. Similar to what payjoin-cli does.
Collaborator
There was a problem hiding this comment.
I'd say lets keep this PR lean and perform the other two checks. This one can be left as a follow up
319d230 to
45fda8a
Compare
Author
|
Ideally I think we should wait on payjoin/rust-payjoin#883 so we don't get so many changes in the cargo toml here and we can keep it pointed to a branch at least somewhat consistently |
Merged
45fda8a to
4847e9a
Compare
4847e9a to
7d30c94
Compare
Directly reference data made available within liana and do not actually use the closure that calls out to rust-payjoin.
7d30c94 to
81d4cde
Compare
arminsabouri
approved these changes
Jul 24, 2025
| let proposal = proposal | ||
| .identify_receiver_outputs(|_| Ok(true)) | ||
| .identify_receiver_outputs(|script| { | ||
| let address = bitcoin::Address::from_script(script, db_conn.network()).unwrap(); |
Collaborator
There was a problem hiding this comment.
Unwrap here is ok bc we need to do a larger error type refactor. But it can be trivially replaced with ? bc the error type in Box dyn error
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This implements the state checks for
check_inputs_not_ownedandidentify_receiver_outputsI have leftcheck_inputs_not_seen_beforeas there is a new table we need to add to keep track of these inputs.