fix(transaction): use writeInt32 to write version

We are reading `version` as `int32` so we should write it as that as
well.
This commit is contained in:
Otto Allmendinger 2021-08-17 09:25:33 +02:00
parent 27a840aac4
commit 6b71eb0c65
No known key found for this signature in database
GPG key ID: F70EC94A6EACFBE3
3 changed files with 12 additions and 2 deletions

View file

@ -316,7 +316,7 @@ class Transaction {
tbuffer = Buffer.allocUnsafe(156 + varSliceSize(prevOutScript));
bufferWriter = new bufferutils_1.BufferWriter(tbuffer, 0);
const input = this.ins[inIndex];
bufferWriter.writeUInt32(this.version);
bufferWriter.writeInt32(this.version);
bufferWriter.writeSlice(hashPrevouts);
bufferWriter.writeSlice(hashSequence);
bufferWriter.writeSlice(input.hash);