diff --git a/CoreBitcoin/BTCScript.m b/CoreBitcoin/BTCScript.m index 772519f1..46d7ceca 100644 --- a/CoreBitcoin/BTCScript.m +++ b/CoreBitcoin/BTCScript.m @@ -1119,7 +1119,7 @@ + (BTCScriptChunk*) parseChunkFromData:(NSData*)scriptData offset:(NSUInteger)of if (offset + sizeof(dataLength) > length) return nil; memcpy(&dataLength, bytes + offset + sizeof(opcode), sizeof(dataLength)); - dataLength = CFSwapInt16LittleToHost(dataLength); + dataLength = CFSwapInt32LittleToHost(dataLength); NSUInteger chunkLength = sizeof(opcode) + sizeof(dataLength) + dataLength;