aboutsummaryrefslogtreecommitdiffstats
path: root/rlp/encode.go
diff options
context:
space:
mode:
Diffstat (limited to 'rlp/encode.go')
-rw-r--r--rlp/encode.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/rlp/encode.go b/rlp/encode.go
index 9d11d66bf..42bbb876c 100644
--- a/rlp/encode.go
+++ b/rlp/encode.go
@@ -386,7 +386,12 @@ func writeUint(val reflect.Value, w *encbuf) error {
}
func writeBigIntPtr(val reflect.Value, w *encbuf) error {
- return writeBigInt(val.Interface().(*big.Int), w)
+ ptr := val.Interface().(*big.Int)
+ if ptr == nil {
+ w.str = append(w.str, 0x80)
+ return nil
+ }
+ return writeBigInt(ptr, w)
}
func writeBigIntNoPtr(val reflect.Value, w *encbuf) error {