Skip to content

[BIP78] Fix client implementation when there is output substitution#1171

Merged
kallewoof merged 1 commit intobitcoin:masterfrom
NicolasDorier:woieuq
Aug 31, 2021
Merged

[BIP78] Fix client implementation when there is output substitution#1171
kallewoof merged 1 commit intobitcoin:masterfrom
NicolasDorier:woieuq

Conversation

@NicolasDorier
Copy link
Copy Markdown
Contributor

@NicolasDorier NicolasDorier commented Aug 31, 2021

There was a bug in the payjoin client reference implementation if the receiver used output substitution, causing the payjoin to fallback to normal payment unecessarily.

Fixing bug reported by @Kixunil (btcpayserver/btcpayserver#2677)
Fixed on the C# client (btcpayserver/BTCPayServer.BIP78@451e112) and tested by Kixunil.

The bug was best explained by @Kixunil


  • The code was iterating over proposed PSBT outputs and have original outputs in a queue.
  • It was comparing the proposed output to the output at the front of the queue
  • If there are two outputs: payee, payer_change - in this order, then if payee substituted the output, the comparison is false. Then we did nothing with it and thus leaving the output in the queue, blocking the remaining iterations from seeing following outputs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants