mirror of
https://gitlab.com/pulsechaincom/go-pulse.git
synced 2024-12-25 12:57:17 +00:00
Logging messages
This commit is contained in:
parent
0acdeca3d6
commit
e20b113053
@ -14,7 +14,7 @@ import (
|
|||||||
"github.com/ethereum/eth-go/ethwire"
|
"github.com/ethereum/eth-go/ethwire"
|
||||||
)
|
)
|
||||||
|
|
||||||
var poollogger = ethlog.NewLogger("[BPOOL]")
|
var poollogger = ethlog.NewLogger("BPOOL")
|
||||||
|
|
||||||
type block struct {
|
type block struct {
|
||||||
from *Peer
|
from *Peer
|
||||||
@ -71,6 +71,8 @@ func (self *BlockPool) SetBlock(b *ethchain.Block, peer *Peer) {
|
|||||||
hash := string(b.Hash())
|
hash := string(b.Hash())
|
||||||
|
|
||||||
if self.pool[hash] == nil && !self.eth.BlockChain().HasBlock(b.Hash()) {
|
if self.pool[hash] == nil && !self.eth.BlockChain().HasBlock(b.Hash()) {
|
||||||
|
poollogger.Infof("Got unrequested block (%x...)\n", hash[0:4])
|
||||||
|
|
||||||
self.hashPool = append(self.hashPool, b.Hash())
|
self.hashPool = append(self.hashPool, b.Hash())
|
||||||
self.pool[hash] = &block{peer, peer, b, time.Now(), 0}
|
self.pool[hash] = &block{peer, peer, b, time.Now(), 0}
|
||||||
|
|
||||||
|
@ -251,7 +251,7 @@ func (sm *StateManager) Process(block *Block, dontReact bool) (err error) {
|
|||||||
fk := append([]byte("bloom"), block.Hash()...)
|
fk := append([]byte("bloom"), block.Hash()...)
|
||||||
sm.Ethereum.Db().Put(fk, filter.Bin())
|
sm.Ethereum.Db().Put(fk, filter.Bin())
|
||||||
|
|
||||||
statelogger.Debugf("Added block #%d (%x)\n", block.Number, block.Hash())
|
statelogger.Infof("Imported block #%d (%x...)\n", block.Number, block.Hash()[0:4])
|
||||||
if dontReact == false {
|
if dontReact == false {
|
||||||
sm.Ethereum.Reactor().Post("newBlock", block)
|
sm.Ethereum.Reactor().Post("newBlock", block)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user