Removed exported fields from state object and added proper set/getters

This commit is contained in:
obscuren
2015-02-20 14:19:34 +01:00
parent 5c975dd4ed
commit ea9a549bbd
9 changed files with 64 additions and 47 deletions

View File

@ -138,8 +138,8 @@ func (self *StateTransition) preCheck() (err error) {
)
// Make sure this transaction's nonce is correct
if sender.Nonce != msg.Nonce() {
return NonceError(msg.Nonce(), sender.Nonce)
if sender.Nonce() != msg.Nonce() {
return NonceError(msg.Nonce(), sender.Nonce())
}
// Pre-pay gas / Buy gas of the coinbase account
@ -166,7 +166,7 @@ func (self *StateTransition) TransitionState() (ret []byte, err error) {
defer self.RefundGas()
// Increment the nonce for the next transaction
self.state.SetNonce(sender.Address(), sender.Nonce+1)
self.state.SetNonce(sender.Address(), sender.Nonce()+1)
//sender.Nonce += 1
// Transaction gas
@ -242,7 +242,7 @@ func MakeContract(msg Message, state *state.StateDB) *state.StateObject {
addr := AddressFromMessage(msg)
contract := state.GetOrNewStateObject(addr)
contract.InitCode = msg.Data()
contract.SetInitCode(msg.Data())
return contract
}