GetCurrentBlock returns a block number of latest known header from the current canonical chain.
(client *ethclient.Client)
| 259 | // GetCurrentBlock returns a block number of latest known header from the |
| 260 | // current canonical chain. |
| 261 | func GetCurrentBlock(client *ethclient.Client) (blknum uint64, err error) { |
| 262 | var header *types.Header |
| 263 | header, err = client.HeaderByNumber(context.Background(), nil) |
| 264 | if err == nil { |
| 265 | blknum = header.Number.Uint64() |
| 266 | } |
| 267 | return |
| 268 | } |
| 269 | |
| 270 | // CheckTransaction return an error if the transaction is failed |
| 271 | func CheckTransaction(client *ethclient.Client, tx *types.Transaction) (err error) { |