Open DanGould opened 1 week ago
Couldn't the field clearing and apply_fee
order be reversed to fix this problem?
Couldn't the field clearing and
apply_fee
order be reversed to fix this problem?
That's not a bad idea, with some caveats:
We should be able to estimate the sender's P2SH weight with InputWightPrediction::new
, however receiver inputs may not yet have the witness element length (because they're not signed before apply_fee
so that would need to be estimated in the upper limit or otherwise saved for another iteration.
https://github.com/payjoin/rust-payjoin/blob/59c3d271e278dafb0a41bcacbde8b3b0d4ec2738/payjoin/src/receive/mod.rs#L976-L978
_Originally posted by @DanGould in https://github.com/payjoin/rust-payjoin/pull/332#discussion_r1750617256_
_Originally posted by @spacebear21 in https://github.com/payjoin/rust-payjoin/pull/332#discussion_r1755734294_