From 508ad51a8644d05bccbc8f8f5e8440f9a383a042 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Mon, 12 Apr 2021 15:09:37 +0300 Subject: [PATCH] core: ignore non-numeric "amounts" in Transfer events Refs. #1900. --- pkg/core/blockchain.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/core/blockchain.go b/pkg/core/blockchain.go index fe354677b..fe9be92e5 100644 --- a/pkg/core/blockchain.go +++ b/pkg/core/blockchain.go @@ -912,6 +912,9 @@ func (bc *Blockchain) handleNotification(note *state.NotificationEvent, d *dao.C if !ok { return } + if len(bs) > bigint.MaxBytesLen { + return // Not a proper number. + } amount = bigint.FromBytes(bs) } bc.processNEP17Transfer(d, h, b, note.ScriptHash, from, to, amount)