Merge pull request #1508 from wpaulino/dust-limit-active-chain

fundingmanager: determine our dust limit based on active chain
This commit is contained in:
Olaoluwa Osuntokun 2018-07-06 19:01:41 -05:00 committed by GitHub
commit 11e7f47f01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2504,11 +2504,19 @@ func (f *fundingManager) handleInitFundingMsg(msg *initFundingMsg) {
localAmt = msg.localFundingAmt localAmt = msg.localFundingAmt
remoteAmt = msg.remoteFundingAmt remoteAmt = msg.remoteFundingAmt
capacity = localAmt + remoteAmt capacity = localAmt + remoteAmt
ourDustLimit = lnwallet.DefaultDustLimit()
minHtlc = msg.minHtlc minHtlc = msg.minHtlc
remoteCsvDelay = msg.remoteCsvDelay 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, "+ fndgLog.Infof("Initiating fundingRequest(localAmt=%v, remoteAmt=%v, "+
"capacity=%v, chainhash=%v, addr=%v, dustLimit=%v)", localAmt, "capacity=%v, chainhash=%v, addr=%v, dustLimit=%v)", localAmt,
msg.pushAmt, capacity, msg.chainHash, msg.peerAddress.Address, msg.pushAmt, capacity, msg.chainHash, msg.peerAddress.Address,