-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
1 addition
and
1 deletion.
There are no files selected for viewing
This file contains 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
This still leaves two bugs:
feePerByte
to some large fee rate, e.g. 100 sat/vb, this will (incorrectly) drop change outputs less than148 * 100 = 14800
sats. That's a considerable amount of money and shouldn't be thrown away. Instead of usingopts.feePerByte
, you should have somedustRelayFeeRate
constant (or option) which is distinct from the fee rate the user is asking for on their transaction. In core, it defaults to 3 sat/vb and most nodes will also use that number.this.dust
is still set to default to148
bytes, which is incorrect. See the comment in core here. 148 is the minimum input size needed to spend a non-segwit UTXO. But core also accounts for the size of the UTXO itself when computing the dust threshold, so actually you wantdust = 148 + 34
.