From b406ca7ae7c66254d95313c80a8358cda9376967 Mon Sep 17 00:00:00 2001 From: Dale Rahn Date: Mon, 28 Oct 2013 23:01:52 -0400 Subject: [PATCH] If ExistsTx fails try looking up the tx, it may be fully spent. --- interface_test.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/interface_test.go b/interface_test.go index 31f4a2ba..907edf00 100644 --- a/interface_test.go +++ b/interface_test.go @@ -184,9 +184,12 @@ func testExistsTxSha(tc *testContext) bool { // The transaction must exist in the database. txHash := tx.Sha() if exists := tc.db.ExistsTxSha(txHash); !exists { - tc.t.Errorf("ExistsTxSha (%s): block #%d (%s) "+ - "tx #%d (%s) does not exist", tc.dbType, - tc.blockHeight, tc.blockHash, i, txHash) + _, err := tc.db.FetchTxBySha(txHash) + if err != nil { + tc.t.Errorf("ExistsTxSha (%s): block #%d (%s) "+ + "tx #%d (%s) does not exist", tc.dbType, + tc.blockHeight, tc.blockHash, i, txHash) + } return false } }