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) {
|
WalletDB.prototype.getPendingKeys = function getPendingKeys(callback) {
|
||||||
var layout = require('./txdb').layout;
|
var layout = require('./txdb').layout;
|
||||||
|
var dummy = new Buffer(0);
|
||||||
var uniq = {};
|
var uniq = {};
|
||||||
|
|
||||||
this.db.iterate({
|
this.db.iterate({
|
||||||
gte: layout.prefix(0x00000000, layout.p(constants.NULL_HASH)),
|
gte: layout.prefix(0x00000000, dummy),
|
||||||
lte: layout.prefix(0xffffffff, layout.p(constants.HIGH_HASH)),
|
lte: layout.prefix(0xffffffff, dummy),
|
||||||
keys: true,
|
keys: true,
|
||||||
parse: function(key) {
|
parse: function(key) {
|
||||||
var wid = layout.pre(key);
|
var wid, hash;
|
||||||
var hash = layout.pp(key);
|
|
||||||
|
if (key[5] !== 0x70)
|
||||||
|
return;
|
||||||
|
|
||||||
|
wid = layout.pre(key);
|
||||||
|
hash = layout.pp(key);
|
||||||
|
|
||||||
if (uniq[hash])
|
if (uniq[hash])
|
||||||
return;
|
return;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user