txdb: fix deterministic weight.
This commit is contained in:
parent
284932f4cf
commit
dc0cbc3637
@ -17,8 +17,8 @@ var KEY1 = 'xprv9s21ZrQH143K3Aj6xQBymM31Zb4BVc7wxqfUhMZrzewdDVCt'
|
|||||||
var KEY2 = 'xprv9s21ZrQH143K3mqiSThzPtWAabQ22Pjp3uSNnZ53A5bQ4udp'
|
var KEY2 = 'xprv9s21ZrQH143K3mqiSThzPtWAabQ22Pjp3uSNnZ53A5bQ4udp'
|
||||||
+ 'faKekc2m4AChLYH1XDzANhrSdxHYWUeTWjYJwFwWFyHkTMnMeAcW4JyRCZa';
|
+ 'faKekc2m4AChLYH1XDzANhrSdxHYWUeTWjYJwFwWFyHkTMnMeAcW4JyRCZa';
|
||||||
|
|
||||||
function dummy() {
|
function dummy(hash) {
|
||||||
var hash = crypto.randomBytes(32).toString('hex');
|
hash = hash || crypto.randomBytes(32).toString('hex');
|
||||||
return {
|
return {
|
||||||
prevout: {
|
prevout: {
|
||||||
hash: hash,
|
hash: hash,
|
||||||
@ -542,7 +542,7 @@ describe('Wallet', function() {
|
|||||||
.addOutput(w1.getAddress(), 5460)
|
.addOutput(w1.getAddress(), 5460)
|
||||||
.addOutput(w1.getAddress(), 5460);
|
.addOutput(w1.getAddress(), 5460);
|
||||||
|
|
||||||
t1.addInput(dummy());
|
t1.addInput(dummy(constants.NULL_HASH));
|
||||||
t1 = t1.toTX();
|
t1 = t1.toTX();
|
||||||
|
|
||||||
yield walletdb.addTX(t1);
|
yield walletdb.addTX(t1);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user