2018-03-04 13:56:49 +00:00
|
|
|
package transaction
|
|
|
|
|
|
|
|
import (
|
2019-09-16 09:18:13 +00:00
|
|
|
"github.com/CityOfZion/neo-go/pkg/io"
|
2018-03-04 13:56:49 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// MinerTX represents a miner transaction.
|
|
|
|
type MinerTX struct {
|
2018-03-25 10:45:54 +00:00
|
|
|
// Random number to avoid hash collision.
|
2018-03-04 13:56:49 +00:00
|
|
|
Nonce uint32
|
|
|
|
}
|
|
|
|
|
2019-09-16 16:31:49 +00:00
|
|
|
// DecodeBinary implements Serializable interface.
|
|
|
|
func (tx *MinerTX) DecodeBinary(r *io.BinReader) {
|
2019-09-16 09:18:13 +00:00
|
|
|
r.ReadLE(&tx.Nonce)
|
2018-03-04 13:56:49 +00:00
|
|
|
}
|
|
|
|
|
2019-09-16 16:31:49 +00:00
|
|
|
// EncodeBinary implements Serializable interface.
|
|
|
|
func (tx *MinerTX) EncodeBinary(w *io.BinWriter) {
|
2019-09-16 09:18:13 +00:00
|
|
|
w.WriteLE(tx.Nonce)
|
2018-03-04 13:56:49 +00:00
|
|
|
}
|