diff --git a/staking/types/transaction.go b/staking/types/transaction.go index d4ba23775..d14bf4ff7 100644 --- a/staking/types/transaction.go +++ b/staking/types/transaction.go @@ -34,7 +34,12 @@ func (d *txdata) CopyFrom(d2 *txdata) { d.Price = new(big.Int).Set(d2.Price) d.GasLimit = d2.GasLimit // TODO: add code to protect crashing - d.StakeMsg = d2.StakeMsg.(StakeMsg).Copy() + // This is workaround, direct RLP encoding/decoding not work + payload, _ := rlp.EncodeToBytes(d2.StakeMsg) + restored, _ := RLPDecodeStakeMsg( + payload, d2.Directive, + ) + d.StakeMsg = restored.(StakeMsg).Copy() d.V = new(big.Int).Set(d2.V) d.R = new(big.Int).Set(d2.R) d.S = new(big.Int).Set(d2.S)