mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-29 15:11:09 +02:00
chainntnfs+sweep: add LookupInputMempoolSpend
and use it in the
sweeper This commit implements a new method, `LookupInputMempoolSpend` to do lookups in the mempool. This method is useful in the case when we only want to know whether an input is already been spent in the mempool by the time we call.
This commit is contained in:
@@ -13,6 +13,7 @@ import (
|
||||
"github.com/btcsuite/btcd/btcutil"
|
||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/lightningnetwork/lnd/fn"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -849,4 +850,9 @@ type MempoolWatcher interface {
|
||||
// CancelMempoolSpendEvent allows the caller to cancel a subscription to
|
||||
// watch for a spend of an outpoint in the mempool.
|
||||
CancelMempoolSpendEvent(sub *MempoolSpendEvent)
|
||||
|
||||
// LookupInputMempoolSpend looks up the mempool to find a spending tx
|
||||
// which spends the given outpoint. A fn.None is returned if it's not
|
||||
// found.
|
||||
LookupInputMempoolSpend(op wire.OutPoint) fn.Option[wire.MsgTx]
|
||||
}
|
||||
|
Reference in New Issue
Block a user