mtx: fix bip69 impl.
This commit is contained in:
parent
9e5989eba5
commit
3b45648750
@ -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());
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Loading…
Reference in New Issue
Block a user