From f5f03e8172ab3ebbb9934142ef757833c0d62300 Mon Sep 17 00:00:00 2001 From: "John C. Vernaleo" Date: Tue, 16 Sep 2014 15:08:53 -0400 Subject: [PATCH] Match error names to btcdb updates. --- txlookup.go | 6 +++--- validate.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/txlookup.go b/txlookup.go index fc9c24b7..2df1499a 100644 --- a/txlookup.go +++ b/txlookup.go @@ -77,7 +77,7 @@ func disconnectTransactions(txStore TxStore, block *btcutil.Block) error { txD.Tx = nil txD.BlockHeight = 0 txD.Spent = nil - txD.Err = btcdb.TxShaMissing + txD.Err = btcdb.ErrTxShaMissing } // Unspend the origin transaction output. @@ -114,7 +114,7 @@ func fetchTxStoreMain(db btcdb.Db, txSet map[btcwire.ShaHash]struct{}, includeSp txList := make([]*btcwire.ShaHash, 0, len(txSet)) for hash := range txSet { hashCopy := hash - txStore[hash] = &TxData{Hash: &hashCopy, Err: btcdb.TxShaMissing} + txStore[hash] = &TxData{Hash: &hashCopy, Err: btcdb.ErrTxShaMissing} txList = append(txList, &hashCopy) } @@ -253,7 +253,7 @@ func (b *BlockChain) fetchInputTransactions(node *blockNode, block *btcutil.Bloc // Add an entry to the transaction store for the needed // transaction with it set to missing by default. originHash := &txIn.PreviousOutpoint.Hash - txD := &TxData{Hash: originHash, Err: btcdb.TxShaMissing} + txD := &TxData{Hash: originHash, Err: btcdb.ErrTxShaMissing} txStore[*originHash] = txD // It is acceptable for a transaction input to reference diff --git a/validate.go b/validate.go index e7a4b659..ae10d683 100644 --- a/validate.go +++ b/validate.go @@ -626,7 +626,7 @@ func (b *BlockChain) checkBIP0030(node *blockNode, block *btcutil.Block) error { switch txD.Err { // A duplicate transaction was not found. This is the most // common case. - case btcdb.TxShaMissing: + case btcdb.ErrTxShaMissing: continue // A duplicate transaction was found. This is only allowed if