Fix CopyFrom!

pull/1921/head
Rongjian Lan 5 years ago
parent 3490c28d74
commit e9d481da31
  1. 2
      staking/types/transaction.go

@ -31,10 +31,10 @@ type txdata struct {
} }
func (d *txdata) CopyFrom(d2 *txdata) { func (d *txdata) CopyFrom(d2 *txdata) {
d.Directive = d2.Directive
d.AccountNonce = d2.AccountNonce d.AccountNonce = d2.AccountNonce
d.Price = new(big.Int).Set(d2.Price) d.Price = new(big.Int).Set(d2.Price)
d.GasLimit = d2.GasLimit d.GasLimit = d2.GasLimit
// TODO: add code to protect crashing
// This is workaround, direct RLP encoding/decoding not work // This is workaround, direct RLP encoding/decoding not work
if d2.StakeMsg == nil { if d2.StakeMsg == nil {
utils.Logger().Debug().Msg("[CopyFrom] d2.StakeMsg is nil") utils.Logger().Debug().Msg("[CopyFrom] d2.StakeMsg is nil")

Loading…
Cancel
Save