mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
16 lines
404 B
Go
16 lines
404 B
Go
|
|
package utils
|
||
|
|
|
||
|
|
import (
|
||
|
|
"github.com/btcsuite/btcd/btcutil"
|
||
|
|
"github.com/btcsuite/btcd/mempool"
|
||
|
|
"github.com/btcsuite/btcd/wire"
|
||
|
|
)
|
||
|
|
|
||
|
|
// DustLimitForPkScript returns the dust limit for a given pkScript. An output
|
||
|
|
// must be greater or equal to this value.
|
||
|
|
func DustLimitForPkScript(pkscript []byte) btcutil.Amount {
|
||
|
|
return btcutil.Amount(mempool.GetDustThreshold(&wire.TxOut{
|
||
|
|
PkScript: pkscript,
|
||
|
|
}))
|
||
|
|
}
|