[bisq-network/bisq] reduce BSQ fee estimation constant for segwit (#5450)

sqrrm notifications at github.com
Fri Apr 30 14:30:51 CEST 2021


@sqrrm commented on this pull request.



> @@ -58,7 +58,7 @@
     public static int TYPICAL_TX_WITH_1_INPUT_VSIZE = 175;
     private static int DEPOSIT_TX_VSIZE = 233;
 
-    private static int BSQ_INPUT_INCREASE = 150;
+    private static int BSQ_INPUT_INCREASE = 65;

For the atomic protocol I use this code to calculate the size. It overestimates a little bit due to sigs sometimes being a byte shorter, but otherwise quite accurate I think. This works since each side is only paying for their own and known inputs and outputs. Not sure if this will work for the normal trade protocol.

```
        // Overhead
        var size = payForOverhead ? 10L : 0L;

        // Inputs and signatures
        for (var input : parent.tx.getInputs()) {
            size += 41 + (input.hasWitness() ? 29 : 108);
        }

        // Outputs
        for (var output : parent.tx.getOutputs()) {
            size += ScriptPattern.isP2WPKH(output.getScriptPubKey()) ? 31 : 34;
        }

        return txFeePerVbyte.multiply(size);
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/5450#discussion_r623839274
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20210430/1917cba0/attachment.htm>


More information about the bisq-github mailing list