aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorZsolt Felfoldi <zsfelfoldi@gmail.com>2016-11-14 20:43:22 +0800
committerZsolt Felfoldi <zsfelfoldi@gmail.com>2016-11-14 21:16:06 +0800
commitb10bcd924ba79f9faa5b8f2d273a7ee02d7b89f5 (patch)
tree9acc32d1edca04b8a2b2894b3177f31c78f8298f /core
parentd8e2e9a41fa0283c8e757a6149c0257d2f8a1ad9 (diff)
downloadgo-tangerine-b10bcd924ba79f9faa5b8f2d273a7ee02d7b89f5.tar.gz
go-tangerine-b10bcd924ba79f9faa5b8f2d273a7ee02d7b89f5.tar.zst
go-tangerine-b10bcd924ba79f9faa5b8f2d273a7ee02d7b89f5.zip
core/types: turn off nonce checking for Call messages
Diffstat (limited to 'core')
-rw-r--r--core/types/transaction.go33
1 files changed, 18 insertions, 15 deletions
diff --git a/core/types/transaction.go b/core/types/transaction.go
index 972a36706..323bfaee6 100644
--- a/core/types/transaction.go
+++ b/core/types/transaction.go
@@ -321,12 +321,13 @@ func (tx *Transaction) SignatureValues() (v byte, r *big.Int, s *big.Int, err er
// XXX Rename message to something less arbitrary?
func (tx *Transaction) AsMessage(s Signer) (Message, error) {
msg := Message{
- nonce: tx.data.AccountNonce,
- price: new(big.Int).Set(tx.data.Price),
- gasLimit: new(big.Int).Set(tx.data.GasLimit),
- to: tx.data.Recipient,
- amount: tx.data.Amount,
- data: tx.data.Payload,
+ nonce: tx.data.AccountNonce,
+ price: new(big.Int).Set(tx.data.Price),
+ gasLimit: new(big.Int).Set(tx.data.GasLimit),
+ to: tx.data.Recipient,
+ amount: tx.data.Amount,
+ data: tx.data.Payload,
+ checkNonce: true,
}
var err error
@@ -535,17 +536,19 @@ type Message struct {
nonce uint64
amount, price, gasLimit *big.Int
data []byte
+ checkNonce bool
}
-func NewMessage(from common.Address, to *common.Address, nonce uint64, amount, gasLimit, price *big.Int, data []byte) Message {
+func NewMessage(from common.Address, to *common.Address, nonce uint64, amount, gasLimit, price *big.Int, data []byte, checkNonce bool) Message {
return Message{
- from: from,
- to: to,
- nonce: nonce,
- amount: amount,
- price: price,
- gasLimit: gasLimit,
- data: data,
+ from: from,
+ to: to,
+ nonce: nonce,
+ amount: amount,
+ price: price,
+ gasLimit: gasLimit,
+ data: data,
+ checkNonce: checkNonce,
}
}
@@ -556,4 +559,4 @@ func (m Message) Value() *big.Int { return m.amount }
func (m Message) Gas() *big.Int { return m.gasLimit }
func (m Message) Nonce() uint64 { return m.nonce }
func (m Message) Data() []byte { return m.data }
-func (m Message) CheckNonce() bool { return true }
+func (m Message) CheckNonce() bool { return m.checkNonce }