walletdb: fix pending tx iteration.
This commit is contained in:
parent
3a5b258209
commit
9b097f97b9
@ -1138,15 +1138,21 @@ WalletDB.prototype.rescan = function rescan(chaindb, height, callback) {
|
||||
|
||||
WalletDB.prototype.getPendingKeys = function getPendingKeys(callback) {
|
||||
var layout = require('./txdb').layout;
|
||||
var dummy = new Buffer(0);
|
||||
var uniq = {};
|
||||
|
||||
this.db.iterate({
|
||||
gte: layout.prefix(0x00000000, layout.p(constants.NULL_HASH)),
|
||||
lte: layout.prefix(0xffffffff, layout.p(constants.HIGH_HASH)),
|
||||
gte: layout.prefix(0x00000000, dummy),
|
||||
lte: layout.prefix(0xffffffff, dummy),
|
||||
keys: true,
|
||||
parse: function(key) {
|
||||
var wid = layout.pre(key);
|
||||
var hash = layout.pp(key);
|
||||
var wid, hash;
|
||||
|
||||
if (key[5] !== 0x70)
|
||||
return;
|
||||
|
||||
wid = layout.pre(key);
|
||||
hash = layout.pp(key);
|
||||
|
||||
if (uniq[hash])
|
||||
return;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user