goimports & golint

pull/1387/head
Eugene Kim 5 years ago
parent b02d1888bf
commit 5e44a2826a
  1. 4
      core/blockchain.go
  2. 4
      core/rawdb/accessors_chain.go
  3. 12
      core/types/block.go

@ -2107,7 +2107,7 @@ func (bc *BlockChain) CXMerkleProof(shardID uint32, block *types.Block) (*types.
} }
// NextCXReceiptsProofUnspentCheckpoint returns the next checkpoint blockNum // NextCXReceiptsProofUnspentCheckpoint returns the next checkpoint blockNum
func (bc *BlockChain) NextCXReceiptsProofUnpentCheckpoint(currentNum uint64, shardID uint32) uint64 { func (bc *BlockChain) NextCXReceiptsProofUnspentCheckpoint(currentNum uint64, shardID uint32) uint64 {
lastCheckpoint, _ := rawdb.ReadCXReceiptsProofUnspentCheckpoint(bc.db, shardID) lastCheckpoint, _ := rawdb.ReadCXReceiptsProofUnspentCheckpoint(bc.db, shardID)
newCheckpoint := lastCheckpoint newCheckpoint := lastCheckpoint
@ -2138,7 +2138,7 @@ func (bc *BlockChain) UpdateCXReceiptsProofUnspentAndCheckpoint(currentNum uint6
if err != nil { if err != nil {
utils.Logger().Warn().Msg("[UpdateCXReceiptsProofUnspentAndCheckpoint] Canot get lastCheckpoint") utils.Logger().Warn().Msg("[UpdateCXReceiptsProofUnspentAndCheckpoint] Canot get lastCheckpoint")
} }
newCheckpoint := bc.NextCXReceiptsProofUnpentCheckpoint(currentNum, shardID) newCheckpoint := bc.NextCXReceiptsProofUnspentCheckpoint(currentNum, shardID)
if lastCheckpoint == newCheckpoint { if lastCheckpoint == newCheckpoint {
return return
} }

@ -32,8 +32,8 @@ import (
// Indicate whether the receipts corresponding to a blockHash is unspent or not // Indicate whether the receipts corresponding to a blockHash is unspent or not
// use a default blockHash as indicator which should be collision resistent // use a default blockHash as indicator which should be collision resistent
var ( var (
SpentHash common.Hash = common.Hash{0x01} SpentHash = common.Hash{0x01}
EmptyHash common.Hash = common.Hash{} EmptyHash = common.Hash{}
) )
// ReadCanonicalHash retrieves the hash assigned to a canonical block number. // ReadCanonicalHash retrieves the hash assigned to a canonical block number.

@ -207,9 +207,9 @@ type StorageBlock Block
// "external" block encoding. used for eth protocol, etc. // "external" block encoding. used for eth protocol, etc.
type extblock struct { type extblock struct {
Header *Header Header *Header
Txs []*Transaction Txs []*Transaction
Uncles []*Header Uncles []*Header
IncomingReceipts CXReceiptsProofs IncomingReceipts CXReceiptsProofs
} }
@ -323,9 +323,9 @@ func (b *Block) DecodeRLP(s *rlp.Stream) error {
// EncodeRLP serializes b into the Ethereum RLP block format. // EncodeRLP serializes b into the Ethereum RLP block format.
func (b *Block) EncodeRLP(w io.Writer) error { func (b *Block) EncodeRLP(w io.Writer) error {
return rlp.Encode(w, extblock{ return rlp.Encode(w, extblock{
Header: b.header, Header: b.header,
Txs: b.transactions, Txs: b.transactions,
Uncles: b.uncles, Uncles: b.uncles,
IncomingReceipts: b.incomingReceipts, IncomingReceipts: b.incomingReceipts,
}) })
} }

Loading…
Cancel
Save