Skip to content

Commit

Permalink
Implement BondsFeeBuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
martonp committed Mar 20, 2023
1 parent 04ca26e commit d6f5aac
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions client/asset/btc/btc.go
Original file line number Diff line number Diff line change
Expand Up @@ -5328,6 +5328,13 @@ func (btc *baseWallet) RefundBond(ctx context.Context, ver uint16, coinID, scrip
return newOutput(txHash, 0, uint64(msgTx.TxOut[0].Value)), nil
}

// BondsFeeBuffer suggests how much extra may be required for the transaction
// fees part of required bond reserves when bond rotation is enabled.
func (btc *baseWallet) BondsFeeBuffer() uint64 {
// 150% of the fee buffer portion of the reserves.
return 15 * bondsFeeBuffer(btc.segwit, btc.feeRateLimit()) / 10
}

type utxo struct {
txHash *chainhash.Hash
vout uint32
Expand Down

0 comments on commit d6f5aac

Please sign in to comment.