chainntnfs/neutrinonotify: log height hint for spend notifications

This commit is contained in:
Olaoluwa Osuntokun 2018-03-01 16:49:19 -08:00
parent 9479b085e2
commit a9dc4f80f2
No known key found for this signature in database
GPG Key ID: 964EA263DD637C21
1 changed files with 5 additions and 1 deletions

View File

@ -285,7 +285,8 @@ func (n *NeutrinoNotifier) notificationDispatcher() {
switch msg := registerMsg.(type) {
case *spendNotification:
chainntnfs.Log.Infof("New spend subscription: "+
"utxo=%v", msg.targetOutpoint)
"utxo=%v, height_hint=%v",
msg.targetOutpoint, msg.heightHint)
op := *msg.targetOutpoint
if _, ok := n.spendNotifications[op]; !ok {
@ -556,6 +557,8 @@ type spendNotification struct {
spendChan chan *chainntnfs.SpendDetail
spendID uint64
heightHint uint32
}
// spendCancel is a message sent to the NeutrinoNotifier when a client wishes
@ -586,6 +589,7 @@ func (n *NeutrinoNotifier) RegisterSpendNtfn(outpoint *wire.OutPoint,
targetOutpoint: outpoint,
spendChan: make(chan *chainntnfs.SpendDetail, 1),
spendID: atomic.AddUint64(&n.spendClientCounter, 1),
heightHint: heightHint,
}
spendEvent := &chainntnfs.SpendEvent{
Spend: ntfn.spendChan,