fundingmanager: determine our dust limit based on active chain

In this commit, we fix an issue where we would always assume the dust
limit was Bitcoin's dust limit, rather than the active chain. This would
lead to issues when attempting to open channels on the Litecon chain.
This commit is contained in:
Wilmer Paulino 2018-07-02 13:10:02 -07:00
parent 92029370ec
commit a7e0d3f57b
No known key found for this signature in database
GPG Key ID: 6DF57B9F9514972F

@ -2504,11 +2504,19 @@ func (f *fundingManager) handleInitFundingMsg(msg *initFundingMsg) {
localAmt = msg.localFundingAmt
remoteAmt = msg.remoteFundingAmt
capacity = localAmt + remoteAmt
ourDustLimit = lnwallet.DefaultDustLimit()
minHtlc = msg.minHtlc
remoteCsvDelay = msg.remoteCsvDelay
)
// We'll determine our dust limit depending on which chain is active.
var ourDustLimit btcutil.Amount
switch registeredChains.PrimaryChain() {
case bitcoinChain:
ourDustLimit = lnwallet.DefaultDustLimit()
case litecoinChain:
ourDustLimit = defaultLitecoinDustLimit
}
fndgLog.Infof("Initiating fundingRequest(localAmt=%v, remoteAmt=%v, "+
"capacity=%v, chainhash=%v, addr=%v, dustLimit=%v)", localAmt,
msg.pushAmt, capacity, msg.chainHash, msg.peerAddress.Address,