mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-01-19 05:45:21 +01:00
lnwallet/btcwallet: update neutrino GetUtxo impl to use new API
This commit is contained in:
parent
f9f9eefab4
commit
84c458cc9f
@ -9,10 +9,10 @@ import (
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/btcsuite/btcutil"
|
||||
|
||||
"github.com/lightninglabs/neutrino"
|
||||
"github.com/lightningnetwork/lnd/lnwallet"
|
||||
"github.com/btcsuite/btcwallet/chain"
|
||||
"github.com/btcsuite/btcwallet/waddrmgr"
|
||||
"github.com/lightninglabs/neutrino"
|
||||
"github.com/lightningnetwork/lnd/lnwallet"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -33,15 +33,21 @@ func (b *BtcWallet) GetBestBlock() (*chainhash.Hash, int32, error) {
|
||||
return b.chain.GetBestBlock()
|
||||
}
|
||||
|
||||
// GetUtxo returns the original output referenced by the passed outpoint.
|
||||
// GetUtxo returns the original output referenced by the passed outpoint that
|
||||
// creates the target pkScript.
|
||||
//
|
||||
// This method is a part of the lnwallet.BlockChainIO interface.
|
||||
func (b *BtcWallet) GetUtxo(op *wire.OutPoint, heightHint uint32) (*wire.TxOut, error) {
|
||||
func (b *BtcWallet) GetUtxo(op *wire.OutPoint, pkScript []byte,
|
||||
heightHint uint32) (*wire.TxOut, error) {
|
||||
|
||||
switch backend := b.chain.(type) {
|
||||
|
||||
case *chain.NeutrinoClient:
|
||||
spendReport, err := backend.CS.GetUtxo(
|
||||
neutrino.WatchOutPoints(*op),
|
||||
neutrino.WatchInputs(neutrino.InputWithScript{
|
||||
OutPoint: *op,
|
||||
PkScript: pkScript,
|
||||
}),
|
||||
neutrino.StartBlock(&waddrmgr.BlockStamp{
|
||||
Height: int32(heightHint),
|
||||
}),
|
||||
|
Loading…
Reference in New Issue
Block a user