diff --git a/core/handle_tx.go b/core/handle_tx.go index 4a1dcb6..8d2c996 100644 --- a/core/handle_tx.go +++ b/core/handle_tx.go @@ -43,7 +43,7 @@ func TxDecode(network string, rawTxStr string) { jsonTx := &json.OrderedResult{ {Key: "txid", Val: tx.TxHash().String()}, - {Key: "txhash", Val: tx.TxHashFull().String()}, + {Key: "txhash", Val: tx.TxHash().String()}, {Key: "version", Val: int32(tx.Version)}, {Key: "locktime", Val: tx.LockTime}, {Key: "expire", Val: tx.Expire}, @@ -74,7 +74,7 @@ func TxEncode(version TxVersionFlag, lockTime TxLockTimeFlag, txIn TxInputsFlag, ErrExit(err) } prevOut := types.NewOutPoint(txHash, input.index) - txIn := types.NewTxInput(prevOut, types.NullValueIn, []byte{}) + txIn := types.NewTxInput(prevOut,[]byte{}) txIn.Sequence = input.sequence if lockTime != 0 { txIn.Sequence = types.MaxTxInSequenceNum - 1 @@ -114,7 +114,7 @@ func TxEncode(version TxVersionFlag, lockTime TxLockTimeFlag, txIn TxInputsFlag, txOut := types.NewTxOutput(uint64(atomic), pkScript) mtx.AddTxOut(txOut) } - mtxHex, err := mtx.Serialize(types.TxSerializeNoWitness) + mtxHex, err := mtx.Serialize() if err != nil { ErrExit(err) } diff --git a/go.mod b/go.mod index 84b9724..fad6845 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/Qitmeer/qx go 1.12 require ( - github.com/Qitmeer/qitmeer-lib v0.0.0-20190821053846-bf695e5493d1 + github.com/Qitmeer/qitmeer-lib v0.0.0-20190822144243-f312929778d5 github.com/pkg/errors v0.8.1 github.com/stretchr/testify v1.3.0 ) diff --git a/go.sum b/go.sum index 45008ab..fc489f5 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,7 @@ github.com/Qitmeer/qitmeer-lib v0.0.0-20190821053846-bf695e5493d1 h1:kMzA31wyrFAQ6b8HuVstU+5jtZHa5ZRkMycI3bTJ+Qw= github.com/Qitmeer/qitmeer-lib v0.0.0-20190821053846-bf695e5493d1/go.mod h1:qQJR7/HBuObR1j4+dt6hLCQ8ZxiyuXjaK8ePeptriJk= +github.com/Qitmeer/qitmeer-lib v0.0.0-20190822144243-f312929778d5 h1:bJA+bSbIMX8gd2KoyTCfZEymLwX2RTUSqmj/uTbb91E= +github.com/Qitmeer/qitmeer-lib v0.0.0-20190822144243-f312929778d5/go.mod h1:qQJR7/HBuObR1j4+dt6hLCQ8ZxiyuXjaK8ePeptriJk= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dchest/blake256 v1.0.0/go.mod h1:xXNWCE1jsAP8DAjP+rKw2MbeqLczjI3TRx2VK+9OEYY=