From 839ce0689e740c912671f84c0867aaa768ea9767 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Thu, 7 Dec 2017 19:09:45 -0800 Subject: [PATCH] chainntnfs/btcdnotify: add additional logic when dispatching ntfns --- chainntnfs/btcdnotify/btcd.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/chainntnfs/btcdnotify/btcd.go b/chainntnfs/btcdnotify/btcd.go index 003bb635c..3b3f16b4e 100644 --- a/chainntnfs/btcdnotify/btcd.go +++ b/chainntnfs/btcdnotify/btcd.go @@ -445,6 +445,8 @@ func (b *BtcdNotifier) attemptHistoricalDispatch( // dispatch it immediately after obtaining for information w.r.t // exactly *when* if got all its confirmations. if uint32(tx.Confirmations) >= msg.numConfirmations { + chainntnfs.Log.Infof("Dispatching %v conf notification", + msg.numConfirmations) msg.finConf <- confDetails return true } @@ -513,8 +515,8 @@ func (b *BtcdNotifier) notifyConfs(newBlockHeight int32) { // is eligible until there are no more eligible entries. nextConf := heap.Pop(b.confHeap).(*confEntry) for nextConf.triggerHeight <= uint32(newBlockHeight) { - // TODO(roasbeef): shake out possible of by one in height calc - // for historical dispatches + chainntnfs.Log.Infof("Dispatching %v conf notification, "+ + "height=%v", nextConf.numConfirmations, newBlockHeight) nextConf.finConf <- nextConf.initialConfDetails if b.confHeap.Len() == 0 {