Browse Source

Merge pull request #644 from chriseth/fix_sequencePointWarning

Fix warning about sequence points.
cl-refactor
chriseth 10 years ago
parent
commit
4df82bc0f3
  1. 2
      libdevcrypto/Common.h
  2. 5
      libethereum/Transaction.cpp

2
libdevcrypto/Common.h

@ -47,7 +47,7 @@ struct SignatureStruct
{
SignatureStruct() {}
SignatureStruct(Signature const& _s) { *(h520*)this = _s; }
SignatureStruct(h256 _r, h256 _s, byte _v): r(_r), s(_s), v(_v) {}
SignatureStruct(h256 const& _r, h256 const& _s, byte _v): r(_r), s(_s), v(_v) {}
operator Signature() const { return *(h520 const*)this; }
/// @returns true if r,s,v values are valid, otherwise false

5
libethereum/Transaction.cpp

@ -43,7 +43,10 @@ Transaction::Transaction(bytesConstRef _rlpData, bool _checkSender)
m_receiveAddress = rlp[field = 3].toHash<Address>();
m_value = rlp[field = 4].toInt<u256>();
m_data = rlp[field = 5].toBytes();
m_vrs = SignatureStruct{ rlp[field = 7].toInt<u256>(), rlp[field = 8].toInt<u256>(), byte(rlp[field = 6].toInt<byte>() - 27) };
h256 r = rlp[field = 7].toInt<u256>();
h256 s = rlp[field = 8].toInt<u256>();
byte v = rlp[field = 6].toInt<byte>() - 27;
m_vrs = SignatureStruct{ r, s, v };
if (_checkSender)
m_sender = sender();
}

Loading…
Cancel
Save