mirror of
https://github.com/LBRYFoundation/lbcd.git
synced 2025-08-30 17:01:29 +00:00
Match error names to btcdb updates.
This commit is contained in:
parent
351a2a5f5e
commit
f5f03e8172
2 changed files with 4 additions and 4 deletions
|
@ -77,7 +77,7 @@ func disconnectTransactions(txStore TxStore, block *btcutil.Block) error {
|
||||||
txD.Tx = nil
|
txD.Tx = nil
|
||||||
txD.BlockHeight = 0
|
txD.BlockHeight = 0
|
||||||
txD.Spent = nil
|
txD.Spent = nil
|
||||||
txD.Err = btcdb.TxShaMissing
|
txD.Err = btcdb.ErrTxShaMissing
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unspend the origin transaction output.
|
// 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))
|
txList := make([]*btcwire.ShaHash, 0, len(txSet))
|
||||||
for hash := range txSet {
|
for hash := range txSet {
|
||||||
hashCopy := hash
|
hashCopy := hash
|
||||||
txStore[hash] = &TxData{Hash: &hashCopy, Err: btcdb.TxShaMissing}
|
txStore[hash] = &TxData{Hash: &hashCopy, Err: btcdb.ErrTxShaMissing}
|
||||||
txList = append(txList, &hashCopy)
|
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
|
// Add an entry to the transaction store for the needed
|
||||||
// transaction with it set to missing by default.
|
// transaction with it set to missing by default.
|
||||||
originHash := &txIn.PreviousOutpoint.Hash
|
originHash := &txIn.PreviousOutpoint.Hash
|
||||||
txD := &TxData{Hash: originHash, Err: btcdb.TxShaMissing}
|
txD := &TxData{Hash: originHash, Err: btcdb.ErrTxShaMissing}
|
||||||
txStore[*originHash] = txD
|
txStore[*originHash] = txD
|
||||||
|
|
||||||
// It is acceptable for a transaction input to reference
|
// It is acceptable for a transaction input to reference
|
||||||
|
|
|
@ -626,7 +626,7 @@ func (b *BlockChain) checkBIP0030(node *blockNode, block *btcutil.Block) error {
|
||||||
switch txD.Err {
|
switch txD.Err {
|
||||||
// A duplicate transaction was not found. This is the most
|
// A duplicate transaction was not found. This is the most
|
||||||
// common case.
|
// common case.
|
||||||
case btcdb.TxShaMissing:
|
case btcdb.ErrTxShaMissing:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
// A duplicate transaction was found. This is only allowed if
|
// A duplicate transaction was found. This is only allowed if
|
||||||
|
|
Loading…
Add table
Reference in a new issue