chainntnfs: add unique ID field to track conf ntfns within notifier
This commit is contained in:
1 parent
ad904ebe8c
commit
c43506dee9
4 files changed
+15
-5
No files matched your search
@@ -61,6 +61,7 @@ type txUpdate struct {
|
||||
// notifications. Multiple concurrent clients are supported. All notifications
|
||||
// are achieved via non-blocking sends on client channels.
|
||||
type BtcdNotifier struct {
|
||||
confClientCounter uint64 // To be used aotmically.
|
||||
spendClientCounter uint64 // To be used atomically.
|
||||
epochClientCounter uint64 // To be used atomically.
|
||||
|
||||
@@ -800,6 +801,7 @@ func (b *BtcdNotifier) RegisterConfirmationsNtfn(txid *chainhash.Hash,
|
||||
|
||||
ntfn := &confirmationNotification{
|
||||
ConfNtfn: chainntnfs.ConfNtfn{
|
||||
ConfID: atomic.AddUint64(&b.confClientCounter, 1),
|
||||
TxID: txid,
|
||||
NumConfirmations: numConfs,
|
||||
Event: chainntnfs.NewConfirmationEvent(numConfs),
|
||||
|
||||
Reference in new issue
Block a user