aboutsummaryrefslogtreecommitdiff
path: root/rpc/types.go
diff options
context:
space:
mode:
authoraaronbuchwald <aaron.buchwald56@gmail.com>2020-09-17 09:36:44 -0400
committerGitHub <noreply@github.com>2020-09-17 09:36:44 -0400
commit42ee77a946d062a4c8e1fabc394ac016ae30e68e (patch)
tree85da01f5b75788e257d3c355917a4b3a8ad8603b /rpc/types.go
parent92fdc0a4b6208387424029182a131b25a2f92dac (diff)
parent6b4efa7ff5537a7cdb1d73b18dd75f56bdadc032 (diff)
Merge pull request #33 from ava-labs/fix-nil-pointer
Fix potential nil pointer dereference
Diffstat (limited to 'rpc/types.go')
-rw-r--r--rpc/types.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/rpc/types.go b/rpc/types.go
index 6575203..3ee46f3 100644
--- a/rpc/types.go
+++ b/rpc/types.go
@@ -148,13 +148,18 @@ func (bnh *BlockNumberOrHash) UnmarshalJSON(data []byte) error {
bnh.BlockNumber = &bn
return nil
case "latest":
- bn := LatestBlockNumber
+ //*bn = LatestBlockNumber
+ bn := AcceptedBlockNumber
bnh.BlockNumber = &bn
return nil
case "pending":
bn := PendingBlockNumber
bnh.BlockNumber = &bn
return nil
+ case "accepted":
+ bn := AcceptedBlockNumber
+ bnh.BlockNumber = &bn
+ return nil
default:
if len(input) == 66 {
hash := common.Hash{}