mtx: fix bip69 impl.

This commit is contained in:
Christopher Jeffrey 2017-01-06 23:59:58 -08:00
parent 9e5989eba5
commit 3b45648750
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -1798,11 +1798,23 @@ function sortRandom(a, b) {
}
function sortInputs(a, b) {
return util.cmp(a.prevout.toRaw(), b.prevout.toRaw());
var ahash = util.revHex(a.prevout.hash);
var bhash = util.revHex(b.prevout.hash);
var res = util.strcmp(ahash, bhash);
if (res !== 0)
return res;
return a.prevout.index - b.prevout.index;
}
function sortOutputs(a, b) {
return util.cmp(a.toRaw(), b.toRaw());
var res = a.value - b.value;
if (res !== 0)
return res;
return util.cmp(a.script.toRaw(), b.script.toRaw());
}
/*