From f9f9eefab402f20c00355e19a7784cadd99a3bd8 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Tue, 17 Jul 2018 19:20:52 -0700 Subject: [PATCH] lnwallet: update GetUtxo to accept the pkScript to comply with new gcs filter --- lnwallet/interface.go | 6 ++++-- lnwallet/script_utils_test.go | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lnwallet/interface.go b/lnwallet/interface.go index 416157fca..d9714a1c0 100644 --- a/lnwallet/interface.go +++ b/lnwallet/interface.go @@ -237,10 +237,12 @@ type BlockChainIO interface { // GetUtxo attempts to return the passed outpoint if it's still a // member of the utxo set. The passed height hint should be the "birth - // height" of the passed outpoint. In the case that the output is in + // height" of the passed outpoint. The script passed should be the + // script that the oupoint creates. In the case that the output is in // the UTXO set, then the output corresponding to that output is // returned. Otherwise, a non-nil error will be returned. - GetUtxo(op *wire.OutPoint, heightHint uint32) (*wire.TxOut, error) + GetUtxo(op *wire.OutPoint, pkScript []byte, + heightHint uint32) (*wire.TxOut, error) // GetBlockHash returns the hash of the block in the best blockchain // at the given height. diff --git a/lnwallet/script_utils_test.go b/lnwallet/script_utils_test.go index 0bfac97a5..7adacba47 100644 --- a/lnwallet/script_utils_test.go +++ b/lnwallet/script_utils_test.go @@ -8,12 +8,12 @@ import ( "testing" "time" - "github.com/lightningnetwork/lnd/keychain" "github.com/btcsuite/btcd/btcec" "github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/btcsuite/btcd/txscript" "github.com/btcsuite/btcd/wire" "github.com/btcsuite/btcutil" + "github.com/lightningnetwork/lnd/keychain" ) // TestCommitmentSpendValidation test the spendability of both outputs within