Skip to content

Commit 1a53071

Browse files
committed
Renamed GetCurrentBlockNumber to GetLatestBlockNumber
The intention of the function is to return the most recent block that was mined (added to the chain) - also called a "tip". Replacing `Current` with `Latest` seems accurate and should reduce the confusion, as `current` may suggest the block that is currently being mined.
1 parent c863874 commit 1a53071

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

pkg/bitcoin/chain.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ type Chain interface {
2020
// rejected eventually.
2121
BroadcastTransaction(transaction *Transaction) error
2222

23-
// GetCurrentBlockNumber gets the number of the current block. If the
24-
// current block was not determined, this function returns an error.
25-
GetCurrentBlockNumber() (uint, error)
23+
// GetLatestBlockNumber gets the height of the latest block (tip). If the
24+
// latest block was not determined, this function returns an error.
25+
GetLatestBlockNumber() (uint, error)
2626

2727
// GetBlockHeader gets the block header for the given block number. If the
2828
// block with the given number was not found on the chain, this function

pkg/bitcoin/electrum/electrum.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func (c *Client) BroadcastTransaction(
2727
panic("not implemented")
2828
}
2929

30-
func (c *Client) GetCurrentBlockNumber() (uint, error) {
30+
func (c *Client) GetLatestBlockNumber() (uint, error) {
3131
// TODO: Implementation.
3232
panic("not implemented")
3333
}

0 commit comments

Comments
 (0)