Use most recent blockNumber when blockNumber parame is nil

This commit is contained in:
Matt Krump
2017-12-14 10:15:36 -06:00
parent 0e837e2d03
commit 84e77f259d
2 changed files with 4 additions and 0 deletions
+3
View File
@@ -24,6 +24,9 @@ type GethBlockchain struct {
}
func (blockchain *GethBlockchain) GetLogs(contract core.Contract, blockNumber *big.Int) ([]core.Log, error) {
if blockNumber == nil {
blockNumber = blockchain.latestBlock()
}
contractAddress := common.HexToAddress(contract.Hash)
fc := ethereum.FilterQuery{
FromBlock: blockNumber,