Transaction: add internal flag to disable size assertion
This commit is contained in:
parent
7a515a14ee
commit
f13650544b
1 changed files with 5 additions and 2 deletions
|
@ -22,7 +22,7 @@ Transaction.SIGHASH_NONE = 0x02
|
|||
Transaction.SIGHASH_SINGLE = 0x03
|
||||
Transaction.SIGHASH_ANYONECANPAY = 0x80
|
||||
|
||||
Transaction.fromBuffer = function(buffer) {
|
||||
Transaction.fromBuffer = function(buffer, __disableAssert) {
|
||||
var offset = 0
|
||||
function readSlice(n) {
|
||||
offset += n
|
||||
|
@ -73,7 +73,10 @@ Transaction.fromBuffer = function(buffer) {
|
|||
}
|
||||
|
||||
tx.locktime = readUInt32()
|
||||
assert.equal(offset, buffer.length, 'Transaction has unexpected data')
|
||||
|
||||
if (!__disableAssert) {
|
||||
assert.equal(offset, buffer.length, 'Transaction has unexpected data')
|
||||
}
|
||||
|
||||
return tx
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue