chainntnfs: ConfirmationEvent now returns details of tx confirmation

This commit modifies the ChainNotifier interface, specifically the
ConfirmationEvent struct to now return additional details concerning
the exact location in the chain that the transaction was confirmed at.

This information will be very useful within the new routing package, as
within the network, channels are identified via their channel-ID which
is a compact encoding of: blockHeight | txIndex | outputIndex
This commit is contained in:
Olaoluwa Osuntokun
2016-12-24 18:39:30 -06:00
parent 42c90794ac
commit 00b0c273da
2 changed files with 25 additions and 7 deletions

View File

@@ -74,7 +74,7 @@ func testSingleConfirmationNotification(miner *rpctest.Harness,
t.Fatalf("unable to generate single block: %v", err)
}
confSent := make(chan int32)
confSent := make(chan *chainntnfs.TxConfirmation)
go func() {
confSent <- <-confIntent.Confirmed
}()
@@ -113,7 +113,7 @@ func testMultiConfirmationNotification(miner *rpctest.Harness,
t.Fatalf("unable to generate single block: %v", err)
}
confSent := make(chan int32)
confSent := make(chan *chainntnfs.TxConfirmation)
go func() {
confSent <- <-confIntent.Confirmed
}()
@@ -173,7 +173,7 @@ func testBatchConfirmationNotification(miner *rpctest.Harness,
t.Fatalf("unable to generate single block: %v", err)
}
confSent := make(chan int32)
confSent := make(chan *chainntnfs.TxConfirmation)
go func() {
confSent <- <-confIntents[i].Confirmed
}()
@@ -445,7 +445,7 @@ func testTxConfirmedBeforeNtfnRegistration(miner *rpctest.Harness,
t.Fatalf("unable to register ntfn: %v", err)
}
confSent := make(chan int32)
confSent := make(chan *chainntnfs.TxConfirmation)
go func() {
confSent <- <-confIntent.Confirmed
}()
@@ -487,7 +487,7 @@ func testTxConfirmedBeforeNtfnRegistration(miner *rpctest.Harness,
t.Fatalf("unable to generate blocks: %v", err)
}
confSent = make(chan int32)
confSent = make(chan *chainntnfs.TxConfirmation)
go func() {
confSent <- <-confIntent.Confirmed
}()