[NOD-668] Rename height to blueScore in OnFilteredBlockAdded. (#589)

This commit is contained in:
stasatdaglabs 2020-01-16 14:10:26 +02:00 committed by Ori Newman
parent a7d3a40465
commit b5f365d282
2 changed files with 6 additions and 6 deletions

View File

@ -21,9 +21,9 @@ func main() {
// for notifications. See the documentation of the rpcclient
// NotificationHandlers type for more details about each handler.
ntfnHandlers := rpcclient.NotificationHandlers{
OnFilteredBlockAdded: func(height uint64, header *wire.BlockHeader, txns []*util.Tx) {
OnFilteredBlockAdded: func(blueScore uint64, header *wire.BlockHeader, txns []*util.Tx) {
log.Printf("Block added: %s (%d) %s",
header.BlockHash(), height, header.Timestamp)
header.BlockHash(), blueScore, header.Timestamp)
},
}

View File

@ -87,8 +87,8 @@ type NotificationHandlers struct {
// bloackDAG. It will only be invoked if a preceding call to
// NotifyBlocks has been made to register for the notification and the
// function is non-nil. Its parameters differ from OnBlockAdded: it
// receives the block's height, header, and relevant transactions.
OnFilteredBlockAdded func(height uint64, header *wire.BlockHeader,
// receives the block's blueScore, header, and relevant transactions.
OnFilteredBlockAdded func(blueScore uint64, header *wire.BlockHeader,
txs []*util.Tx)
// OnChainChanged is invoked when the selected parent chain of the
@ -160,7 +160,7 @@ func (c *Client) handleNotification(ntfn *rawNotification) {
return
}
blockHeight, blockHeader, transactions, err :=
blockBlueScore, blockHeader, transactions, err :=
parseFilteredBlockAddedParams(ntfn.Params)
if err != nil {
log.Warnf("Received invalid filtered block "+
@ -168,7 +168,7 @@ func (c *Client) handleNotification(ntfn *rawNotification) {
return
}
c.ntfnHandlers.OnFilteredBlockAdded(blockHeight,
c.ntfnHandlers.OnFilteredBlockAdded(blockBlueScore,
blockHeader, transactions)
// OnRelevantTxAccepted