fundingmanager+lnd: propose remote channel reserve above dust limit

This commit is contained in:
Wilmer Paulino
2018-05-14 14:03:58 -04:00
parent 3c33a8cb67
commit 2e076ba21e
3 changed files with 29 additions and 16 deletions

15
lnd.go
View File

@@ -464,11 +464,20 @@ func lndMain() error {
cid := lnwire.NewChanIDFromOutPoint(&chanPoint)
return server.htlcSwitch.UpdateShortChanID(cid)
},
RequiredRemoteChanReserve: func(chanAmt btcutil.Amount) btcutil.Amount {
RequiredRemoteChanReserve: func(chanAmt,
dustLimit btcutil.Amount) btcutil.Amount {
// By default, we'll require the remote peer to maintain
// at least 1% of the total channel capacity at all
// times.
return chanAmt / 100
// times. If this value ends up dipping below the dust
// limit, then we'll use the dust limit itself as the
// reserve as required by BOLT #2.
reserve := chanAmt / 100
if reserve < dustLimit {
reserve = dustLimit
}
return reserve
},
RequiredRemoteMaxValue: func(chanAmt btcutil.Amount) lnwire.MilliSatoshi {
// By default, we'll allow the remote peer to fully