diff --git a/cmd/get_logs/main.go b/cmd/get_logs/main.go index c5d5703d..cf9c8140 100644 --- a/cmd/get_logs/main.go +++ b/cmd/get_logs/main.go @@ -15,6 +15,7 @@ func main() { environment := flag.String("environment", "", "Environment name") contractHash := flag.String("contract-hash", "", "Contract hash to show summary") _blockNumber := flag.Int64("block-number", -1, "Block number of summary") + flag.Parse() config := cmd.LoadConfig(*environment) diff --git a/pkg/geth/geth_blockchain.go b/pkg/geth/geth_blockchain.go index 5fdac192..2783691f 100644 --- a/pkg/geth/geth_blockchain.go +++ b/pkg/geth/geth_blockchain.go @@ -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,