Created
November 1, 2017 06:55
-
-
Save mariodian/236a831c4e0dd4772ca866eb81f9cac5 to your computer and use it in GitHub Desktop.
Add nLocktime to a raw Bitcoin transcation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String.prototype.lpad = function(padString, length) { | |
var str = this; | |
while (str.length < length) | |
str = padString + str; | |
return str; | |
} | |
var blockHeight = 434695, | |
rawTx = '<raw transaction>', | |
blockLittleEndian = (blockHeight).toString(16).lpad('0', 8).match(/../g).reverse().join(''); | |
document.write(rawTx.slice(0, -8) + blockLittleEndian); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment