mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-06-06 06:06:49 +00:00
[NOD-668] Rename height to blueScore in OnFilteredBlockAdded. (#589)
This commit is contained in:
parent
a7d3a40465
commit
b5f365d282
@ -21,9 +21,9 @@ func main() {
|
|||||||
// for notifications. See the documentation of the rpcclient
|
// for notifications. See the documentation of the rpcclient
|
||||||
// NotificationHandlers type for more details about each handler.
|
// NotificationHandlers type for more details about each handler.
|
||||||
ntfnHandlers := rpcclient.NotificationHandlers{
|
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",
|
log.Printf("Block added: %s (%d) %s",
|
||||||
header.BlockHash(), height, header.Timestamp)
|
header.BlockHash(), blueScore, header.Timestamp)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,8 +87,8 @@ type NotificationHandlers struct {
|
|||||||
// bloackDAG. It will only be invoked if a preceding call to
|
// bloackDAG. It will only be invoked if a preceding call to
|
||||||
// NotifyBlocks has been made to register for the notification and the
|
// NotifyBlocks has been made to register for the notification and the
|
||||||
// function is non-nil. Its parameters differ from OnBlockAdded: it
|
// function is non-nil. Its parameters differ from OnBlockAdded: it
|
||||||
// receives the block's height, header, and relevant transactions.
|
// receives the block's blueScore, header, and relevant transactions.
|
||||||
OnFilteredBlockAdded func(height uint64, header *wire.BlockHeader,
|
OnFilteredBlockAdded func(blueScore uint64, header *wire.BlockHeader,
|
||||||
txs []*util.Tx)
|
txs []*util.Tx)
|
||||||
|
|
||||||
// OnChainChanged is invoked when the selected parent chain of the
|
// OnChainChanged is invoked when the selected parent chain of the
|
||||||
@ -160,7 +160,7 @@ func (c *Client) handleNotification(ntfn *rawNotification) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
blockHeight, blockHeader, transactions, err :=
|
blockBlueScore, blockHeader, transactions, err :=
|
||||||
parseFilteredBlockAddedParams(ntfn.Params)
|
parseFilteredBlockAddedParams(ntfn.Params)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warnf("Received invalid filtered block "+
|
log.Warnf("Received invalid filtered block "+
|
||||||
@ -168,7 +168,7 @@ func (c *Client) handleNotification(ntfn *rawNotification) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
c.ntfnHandlers.OnFilteredBlockAdded(blockHeight,
|
c.ntfnHandlers.OnFilteredBlockAdded(blockBlueScore,
|
||||||
blockHeader, transactions)
|
blockHeader, transactions)
|
||||||
|
|
||||||
// OnRelevantTxAccepted
|
// OnRelevantTxAccepted
|
||||||
|
Loading…
x
Reference in New Issue
Block a user