mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-22 22:25:24 +01:00
contractcourt: handle mempool min fee error.
In case the mempool backend signals that our transaction does not meet fee requirements when publishing it we will continue to start up now. The transaction will be rebroadcasted in the background and a specific log message will be printed to let the user know that he could increase his mempool size to at least have this transaction in his own mempool.
This commit is contained in:
parent
54bacec422
commit
8314f0a879
2 changed files with 18 additions and 4 deletions
|
@ -553,7 +553,7 @@ func (c *ChannelArbitrator) Start(state *chanArbStartState) error {
|
|||
// StateWaitingFullResolution after we've transitioned from
|
||||
// StateContractClosed which can only be triggered by the local
|
||||
// or remote close trigger. This trigger is only fired when we
|
||||
// receive a chain event from the chain watcher than the
|
||||
// receive a chain event from the chain watcher that the
|
||||
// commitment has been confirmed on chain, and before we
|
||||
// advance our state step, we call InsertConfirmedCommitSet.
|
||||
err := c.relaunchResolvers(state.commitSet, triggerHeight)
|
||||
|
@ -990,11 +990,18 @@ func (c *ChannelArbitrator) stateStep(
|
|||
label := labels.MakeLabel(
|
||||
labels.LabelTypeChannelClose, &c.cfg.ShortChanID,
|
||||
)
|
||||
|
||||
if err := c.cfg.PublishTx(closeTx, label); err != nil {
|
||||
log.Errorf("ChannelArbitrator(%v): unable to broadcast "+
|
||||
"close tx: %v", c.cfg.ChanPoint, err)
|
||||
if err != lnwallet.ErrDoubleSpend {
|
||||
|
||||
// This makes sure we don't fail at startup if the
|
||||
// commitment transaction has too low fees to make it
|
||||
// into mempool. The rebroadcaster makes sure this
|
||||
// transaction is republished regularly until confirmed
|
||||
// or replaced.
|
||||
if !errors.Is(err, lnwallet.ErrDoubleSpend) &&
|
||||
!errors.Is(err, lnwallet.ErrMempoolFee) {
|
||||
|
||||
return StateError, closeTx, err
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package contractcourt
|
|||
import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"sync"
|
||||
|
@ -872,7 +873,13 @@ func (u *UtxoNursery) sweepCribOutput(classHeight uint32, baby *babyOutput) erro
|
|||
// confirmed before transitioning it to kindergarten.
|
||||
label := labels.MakeLabel(labels.LabelTypeSweepTransaction, nil)
|
||||
err := u.cfg.PublishTransaction(baby.timeoutTx, label)
|
||||
if err != nil && err != lnwallet.ErrDoubleSpend {
|
||||
|
||||
// In case the tx does not meet mempool fee requirements we continue
|
||||
// because the tx is rebroadcasted in the background and there is
|
||||
// nothing we can do to bump this transaction anyways.
|
||||
if err != nil && !errors.Is(err, lnwallet.ErrDoubleSpend) &&
|
||||
!errors.Is(err, lnwallet.ErrMempoolFee) {
|
||||
|
||||
utxnLog.Errorf("Unable to broadcast baby tx: "+
|
||||
"%v, %v", err, spew.Sdump(baby.timeoutTx))
|
||||
return err
|
||||
|
|
Loading…
Add table
Reference in a new issue