rust-payjoin icon indicating copy to clipboard operation
rust-payjoin copied to clipboard

NS1R proposal builder should not accept duplicate proposal

Open arminsabouri opened this issue 9 months ago • 1 comments

This is working as expected but I do wonder if contexts here should be len == 1. Since both the hpke context and the proposal is the same it would make sense to me that UncheckedProposalBuilder.add() would disallow the caller to add duplicate sessions. I still think the ns1r session would succeed bc only one PSBT ends up on the directory for this hpke session but it still seems wrong and error prone. This is outside the scope of this PR.

Originally posted by @0xBEEFCAF3 in https://github.com/payjoin/rust-payjoin/pull/632#discussion_r2037346020

arminsabouri avatar Apr 10 '25 13:04 arminsabouri

Two cases:

  1. Where the session is duplicated.
  2. Different session same PSBT

arminsabouri avatar Apr 10 '25 14:04 arminsabouri