aboutsummaryrefslogtreecommitdiffstats
path: root/ethutil
diff options
context:
space:
mode:
Diffstat (limited to 'ethutil')
-rw-r--r--ethutil/rlp.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/ethutil/rlp.go b/ethutil/rlp.go
index e6c75696e..d95ace425 100644
--- a/ethutil/rlp.go
+++ b/ethutil/rlp.go
@@ -186,7 +186,12 @@ func Encode(object interface{}) []byte {
case byte:
buff.Write(Encode(big.NewInt(int64(t))))
case *big.Int:
- buff.Write(Encode(t.Bytes()))
+ // Not sure how this is possible while we check for
+ if t == nil {
+ buff.WriteByte(0xc0)
+ } else {
+ buff.Write(Encode(t.Bytes()))
+ }
case []byte:
if len(t) == 1 && t[0] <= 0x7f {
buff.Write(t)