From 968b6da5dbf2d80cbae2d88389132c833590f5dc Mon Sep 17 00:00:00 2001 From: Jonathan Gillham Date: Wed, 1 Oct 2014 13:52:19 +0100 Subject: [PATCH] Changed TxIn.PreviousOutpoint to TxIn.PreviousOutPoint after btcwire API change. --- ldb/dup_test.go | 4 ++-- ldb/insertremove_test.go | 6 +++--- ldb/leveldb.go | 8 ++++---- ldb/operational_test.go | 4 ++-- memdb/memdb.go | 8 ++++---- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/ldb/dup_test.go b/ldb/dup_test.go index b2a7ca3d..1ce933bb 100644 --- a/ldb/dup_test.go +++ b/ldb/dup_test.go @@ -56,10 +56,10 @@ out: var txneededList []*btcwire.ShaHash for _, tx := range mblock.Transactions { for _, txin := range tx.TxIn { - if txin.PreviousOutpoint.Index == uint32(4294967295) { + if txin.PreviousOutPoint.Index == uint32(4294967295) { continue } - origintxsha := &txin.PreviousOutpoint.Hash + origintxsha := &txin.PreviousOutPoint.Hash txneededList = append(txneededList, origintxsha) exists, err := db.ExistsTxSha(origintxsha) diff --git a/ldb/insertremove_test.go b/ldb/insertremove_test.go index 217502ef..0481af8b 100644 --- a/ldb/insertremove_test.go +++ b/ldb/insertremove_test.go @@ -74,12 +74,12 @@ endtest: var txInList []*btcwire.OutPoint for _, tx := range mblock.Transactions { for _, txin := range tx.TxIn { - if txin.PreviousOutpoint.Index == uint32(4294967295) { + if txin.PreviousOutPoint.Index == uint32(4294967295) { continue } - origintxsha := &txin.PreviousOutpoint.Hash + origintxsha := &txin.PreviousOutPoint.Hash - txInList = append(txInList, &txin.PreviousOutpoint) + txInList = append(txInList, &txin.PreviousOutPoint) txneededList = append(txneededList, origintxsha) txlookupList = append(txlookupList, origintxsha) diff --git a/ldb/leveldb.go b/ldb/leveldb.go index ad1bb3c3..8c7ab826 100644 --- a/ldb/leveldb.go +++ b/ldb/leveldb.go @@ -455,8 +455,8 @@ func (db *LevelDb) doSpend(tx *btcwire.MsgTx) error { for txinidx := range tx.TxIn { txin := tx.TxIn[txinidx] - inTxSha := txin.PreviousOutpoint.Hash - inTxidx := txin.PreviousOutpoint.Index + inTxSha := txin.PreviousOutPoint.Hash + inTxidx := txin.PreviousOutPoint.Index if inTxidx == ^uint32(0) { continue @@ -478,8 +478,8 @@ func (db *LevelDb) unSpend(tx *btcwire.MsgTx) error { for txinidx := range tx.TxIn { txin := tx.TxIn[txinidx] - inTxSha := txin.PreviousOutpoint.Hash - inTxidx := txin.PreviousOutpoint.Index + inTxSha := txin.PreviousOutPoint.Hash + inTxidx := txin.PreviousOutPoint.Index if inTxidx == ^uint32(0) { continue diff --git a/ldb/operational_test.go b/ldb/operational_test.go index c0a3ca1e..a31564dc 100644 --- a/ldb/operational_test.go +++ b/ldb/operational_test.go @@ -65,10 +65,10 @@ out: var txneededList []*btcwire.ShaHash for _, tx := range mblock.Transactions { for _, txin := range tx.TxIn { - if txin.PreviousOutpoint.Index == uint32(4294967295) { + if txin.PreviousOutPoint.Index == uint32(4294967295) { continue } - origintxsha := &txin.PreviousOutpoint.Hash + origintxsha := &txin.PreviousOutPoint.Hash txneededList = append(txneededList, origintxsha) exists, err := db.ExistsTxSha(origintxsha) diff --git a/memdb/memdb.go b/memdb/memdb.go index 713a3c0a..20691b8c 100644 --- a/memdb/memdb.go +++ b/memdb/memdb.go @@ -52,7 +52,7 @@ func newShaHashFromStr(hexStr string) *btcwire.ShaHash { // a single input that has a previous output transaction index set to the // maximum value along with a zero hash. func isCoinbaseInput(txIn *btcwire.TxIn) bool { - prevOut := &txIn.PreviousOutpoint + prevOut := &txIn.PreviousOutPoint if prevOut.Index == math.MaxUint32 && prevOut.Hash.IsEqual(&zeroHash) { return true } @@ -105,7 +105,7 @@ func (db *MemDb) removeTx(msgTx *btcwire.MsgTx, txHash *btcwire.ShaHash) { continue } - prevOut := &txIn.PreviousOutpoint + prevOut := &txIn.PreviousOutPoint originTxns, exists := db.txns[prevOut.Hash] if !exists { log.Warnf("Unable to find input transaction %s to "+ @@ -593,7 +593,7 @@ func (db *MemDb) InsertBlock(block *btcutil.Block) (int64, error) { // the output of another transaction in this block only // if the referenced transaction comes before the // current one in this block. - prevOut := &txIn.PreviousOutpoint + prevOut := &txIn.PreviousOutPoint if inFlightIndex, ok := txInFlight[prevOut.Hash]; ok { if i <= inFlightIndex { log.Warnf("InsertBlock: requested hash "+ @@ -661,7 +661,7 @@ func (db *MemDb) InsertBlock(block *btcutil.Block) (int64, error) { } // Already checked for existing and valid ranges above. - prevOut := &txIn.PreviousOutpoint + prevOut := &txIn.PreviousOutPoint originTxns := db.txns[prevOut.Hash] originTxD := originTxns[len(originTxns)-1] originTxD.spentBuf[prevOut.Index] = true