Fix TxOut serialization (fixes SIGHASH_SINGLE hashing)

This commit is contained in:
Matt Corallo
2013-06-02 20:45:03 +02:00
committed by Mike Hearn
parent 07baa230f3
commit c6b3b82a66

View File

@@ -138,7 +138,7 @@ public class TransactionOutput extends ChildMessage implements Serializable {
@Override
protected void bitcoinSerializeToStream(OutputStream stream) throws IOException {
checkNotNull(scriptBytes);
Utils.uint64ToByteStreamLE(getValue(), stream);
Utils.int64ToByteStreamLE(getValue().longValue(), stream);
// TODO: Move script serialization into the Script class, where it belongs.
stream.write(new VarInt(scriptBytes.length).encode());
stream.write(scriptBytes);