Update for recent btcutil Block.Sha API change.
This commit is contained in:
parent
65b044eea2
commit
750d657666
15 changed files with 30 additions and 99 deletions
database
|
@ -372,11 +372,7 @@ func (db *LevelDb) InsertBlock(block *btcutil.Block) (height int64, rerr error)
|
|||
}
|
||||
}()
|
||||
|
||||
blocksha, err := block.Sha()
|
||||
if err != nil {
|
||||
log.Warnf("Failed to compute block sha %v", blocksha)
|
||||
return 0, err
|
||||
}
|
||||
blocksha := block.Sha()
|
||||
mblock := block.MsgBlock()
|
||||
rawMsg, err := block.Bytes()
|
||||
if err != nil {
|
||||
|
|
|
@ -537,11 +537,6 @@ func (db *MemDb) InsertBlock(block *btcutil.Block) (int64, error) {
|
|||
return 0, ErrDbClosed
|
||||
}
|
||||
|
||||
blockHash, err := block.Sha()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
// Reject the insert if the previously reference block does not exist
|
||||
// except in the case there are no blocks inserted yet where the first
|
||||
// inserted block is assumed to be a genesis block.
|
||||
|
@ -640,7 +635,7 @@ func (db *MemDb) InsertBlock(block *btcutil.Block) (int64, error) {
|
|||
}
|
||||
|
||||
db.blocks = append(db.blocks, msgBlock)
|
||||
db.blocksBySha[*blockHash] = newHeight
|
||||
db.blocksBySha[*block.Sha()] = newHeight
|
||||
|
||||
// Insert information about eacj transaction and spend all of the
|
||||
// outputs referenced by the inputs to the transactions.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue