From 9d5fa95729446a9437005448e6a3b0a70011997e Mon Sep 17 00:00:00 2001 From: Alex Sharov Date: Mon, 1 Nov 2021 11:17:16 +0700 Subject: [PATCH] Derive chainid no alloc (#142) --- txpool/types.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/txpool/types.go b/txpool/types.go index 7c54f5ec7..760c400bf 100644 --- a/txpool/types.go +++ b/txpool/types.go @@ -322,9 +322,8 @@ func (ctx *TxParseContext) ParseTransaction(payload []byte, pos int, slot *TxSlo sigHashLen += uint(chainIdLen) // For chainId sigHashLen += 2 // For two extra zeros - //vByte = byte(1 - (ctx.v.Uint64() & 1)) ctx.deriveChainID.Sub(&ctx.v, &ctx.chainIDMul) - vByte = ctx.deriveChainID.Sub(&ctx.deriveChainID, u256.N8).Bytes()[0] - 27 + vByte = byte(ctx.deriveChainID.Sub(&ctx.deriveChainID, u256.N8).Uint64() - 27) } } else { var v uint64