From 8a440a4016166cd633425a12e78ca6d6de437dc0 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Tue, 14 Sep 2021 15:18:38 +0300 Subject: [PATCH] transaction: fix ContentTypeNotSupported oracle code processing Fix testnet block 311487 block processing and synchronization errors: 2021-09-14T15:18:53.611+0300 WARN peer disconnected {"addr": "20.198.226.132:20333", "reason": "invalid oracle response code", "peerCount": 10} Fix 8e9302f40b76964e0af1c7f8812a1f81cd67be2c. --- pkg/core/transaction/oracle.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/core/transaction/oracle.go b/pkg/core/transaction/oracle.go index e9ee0598a..1442c80b3 100644 --- a/pkg/core/transaction/oracle.go +++ b/pkg/core/transaction/oracle.go @@ -48,7 +48,7 @@ var ( func (c OracleResponseCode) IsValid() bool { return c == Success || c == ProtocolNotSupported || c == ConsensusUnreachable || c == NotFound || c == Timeout || c == Forbidden || c == ResponseTooLarge || - c == InsufficientFunds || c == Error + c == InsufficientFunds || c == ContentTypeNotSupported || c == Error } // MarshalJSON implements json.Marshaler interface. @@ -80,6 +80,8 @@ func (c *OracleResponseCode) UnmarshalJSON(data []byte) error { *c = ResponseTooLarge case "insufficientfunds": *c = InsufficientFunds + case "contenttypenotsupported": + *c = ContentTypeNotSupported case "error": *c = Error default: