Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

Commit

Permalink
fix hash calculation for eip155 transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimitry authored and winsvega committed Nov 22, 2016
1 parent bfa7983 commit 6f2fa5c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libethcore/Transaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ void TransactionBase::streamRLP(RLPStream& _s, IncludeSignature _sig, bool _forE
{
if (m_type == NullTransaction)
return;

_s.appendList((_sig || _forEip155hash ? 3 : 0) + 6);
_s << m_nonce << m_gasPrice << m_gas;
if (m_type == MessageCall)
Expand Down Expand Up @@ -175,7 +176,7 @@ h256 TransactionBase::sha3(IncludeSignature _sig) const
return m_hashWith;

RLPStream s;
streamRLP(s, _sig, m_chainId > 0);
streamRLP(s, _sig, m_chainId > 0 && _sig == WithoutSignature);

auto ret = dev::sha3(s.out());
if (_sig == WithSignature)
Expand Down

0 comments on commit 6f2fa5c

Please sign in to comment.