Update example code.

Example code used old api for
OnBlockConnected and OnBlockDisconnected
This commit is contained in:
John C. Vernaleo 2015-06-18 16:21:03 -04:00
parent 1831071905
commit 7cb04ae6db

View file

@ -21,11 +21,11 @@ func main() {
// for notifications. See the documentation of the btcrpcclient // for notifications. See the documentation of the btcrpcclient
// NotificationHandlers type for more details about each handler. // NotificationHandlers type for more details about each handler.
ntfnHandlers := btcrpcclient.NotificationHandlers{ ntfnHandlers := btcrpcclient.NotificationHandlers{
OnBlockConnected: func(hash *wire.ShaHash, height int32) { OnBlockConnected: func(hash *wire.ShaHash, height int32, time time.Time) {
log.Printf("Block connected: %v (%d)", hash, height) log.Printf("Block connected: %v (%d) %v", hash, height, time)
}, },
OnBlockDisconnected: func(hash *wire.ShaHash, height int32) { OnBlockDisconnected: func(hash *wire.ShaHash, height int32, time time.Time) {
log.Printf("Block disconnected: %v (%d)", hash, height) log.Printf("Block disconnected: %v (%d) %v", hash, height, time)
}, },
} }