chainntnfs: Fix stylistic issues.
This commit is contained in:
parent
280e264e8c
commit
bc7c834362
@ -300,6 +300,7 @@ out:
|
|||||||
chainntnfs.Log.Warnf("Received blocks out of order: "+
|
chainntnfs.Log.Warnf("Received blocks out of order: "+
|
||||||
"current height=%d, new height=%d",
|
"current height=%d, new height=%d",
|
||||||
currentHeight, update.blockHeight)
|
currentHeight, update.blockHeight)
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
currentHeight = update.blockHeight
|
currentHeight = update.blockHeight
|
||||||
@ -321,22 +322,24 @@ out:
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
chainntnfs.Log.Error(err)
|
chainntnfs.Log.Error(err)
|
||||||
}
|
}
|
||||||
} else {
|
continue
|
||||||
if update.blockHeight != currentHeight {
|
}
|
||||||
chainntnfs.Log.Warnf("Received blocks out of order: "+
|
|
||||||
"current height=%d, disconnected height=%d",
|
|
||||||
currentHeight, update.blockHeight)
|
|
||||||
}
|
|
||||||
|
|
||||||
currentHeight = update.blockHeight - 1
|
if update.blockHeight != currentHeight {
|
||||||
|
chainntnfs.Log.Warnf("Received blocks out of order: "+
|
||||||
|
"current height=%d, disconnected height=%d",
|
||||||
|
currentHeight, update.blockHeight)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
chainntnfs.Log.Infof("Block disconnected from main chain: "+
|
currentHeight = update.blockHeight - 1
|
||||||
"height=%v, sha=%v", update.blockHeight, update.blockHash)
|
|
||||||
|
|
||||||
err := b.txConfNotifier.DisconnectTip(uint32(update.blockHeight))
|
chainntnfs.Log.Infof("Block disconnected from main chain: "+
|
||||||
if err != nil {
|
"height=%v, sha=%v", update.blockHeight, update.blockHash)
|
||||||
chainntnfs.Log.Error(err)
|
|
||||||
}
|
err := b.txConfNotifier.DisconnectTip(uint32(update.blockHeight))
|
||||||
|
if err != nil {
|
||||||
|
chainntnfs.Log.Error(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
case item := <-b.txUpdates.ChanOut():
|
case item := <-b.txUpdates.ChanOut():
|
||||||
|
@ -334,6 +334,8 @@ func (n *NeutrinoNotifier) notificationDispatcher() {
|
|||||||
chainntnfs.Log.Warnf("Received blocks out of order: "+
|
chainntnfs.Log.Warnf("Received blocks out of order: "+
|
||||||
"current height=%d, new height=%d",
|
"current height=%d, new height=%d",
|
||||||
n.bestHeight, update.height)
|
n.bestHeight, update.height)
|
||||||
|
n.heightMtx.Unlock()
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
n.bestHeight = update.height
|
n.bestHeight = update.height
|
||||||
@ -346,25 +348,29 @@ func (n *NeutrinoNotifier) notificationDispatcher() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
chainntnfs.Log.Error(err)
|
chainntnfs.Log.Error(err)
|
||||||
}
|
}
|
||||||
} else {
|
continue
|
||||||
n.heightMtx.Lock()
|
|
||||||
if update.height != n.bestHeight {
|
|
||||||
chainntnfs.Log.Warnf("Received blocks out of order: "+
|
|
||||||
"current height=%d, disconnected height=%d",
|
|
||||||
n.bestHeight, update.height)
|
|
||||||
}
|
|
||||||
|
|
||||||
n.bestHeight = update.height - 1
|
|
||||||
n.heightMtx.Unlock()
|
|
||||||
|
|
||||||
chainntnfs.Log.Infof("Block disconnected from main chain: "+
|
|
||||||
"height=%v, sha=%v", update.height, update.hash)
|
|
||||||
|
|
||||||
err := n.txConfNotifier.DisconnectTip(update.height)
|
|
||||||
if err != nil {
|
|
||||||
chainntnfs.Log.Error(err)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
n.heightMtx.Lock()
|
||||||
|
if update.height != n.bestHeight {
|
||||||
|
chainntnfs.Log.Warnf("Received blocks out of order: "+
|
||||||
|
"current height=%d, disconnected height=%d",
|
||||||
|
n.bestHeight, update.height)
|
||||||
|
n.heightMtx.Unlock()
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
n.bestHeight = update.height - 1
|
||||||
|
n.heightMtx.Unlock()
|
||||||
|
|
||||||
|
chainntnfs.Log.Infof("Block disconnected from main chain: "+
|
||||||
|
"height=%v, sha=%v", update.height, update.hash)
|
||||||
|
|
||||||
|
err := n.txConfNotifier.DisconnectTip(update.height)
|
||||||
|
if err != nil {
|
||||||
|
chainntnfs.Log.Error(err)
|
||||||
|
}
|
||||||
|
|
||||||
case err := <-n.rescanErr:
|
case err := <-n.rescanErr:
|
||||||
chainntnfs.Log.Errorf("Error during rescan: %v", err)
|
chainntnfs.Log.Errorf("Error during rescan: %v", err)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user