pool: fix relay of pending TX
This commit is contained in:
parent
3c6949e756
commit
c69660d81d
@ -378,13 +378,6 @@ Pool.prototype.addWallet = function addWallet(w, defaultTs) {
|
|||||||
this.watch(w.getHash());
|
this.watch(w.getHash());
|
||||||
this.watch(w.getPublicKey());
|
this.watch(w.getPublicKey());
|
||||||
|
|
||||||
// Relay pending TXs
|
|
||||||
// NOTE: It is important to do it after search, because search could
|
|
||||||
// add TS to pending TXs, thus making them confirmed
|
|
||||||
w.pending().forEach(function(tx) {
|
|
||||||
this.sendTX(tx);
|
|
||||||
}, this);
|
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
var e = new EventEmitter();
|
var e = new EventEmitter();
|
||||||
if (w.loaded)
|
if (w.loaded)
|
||||||
@ -393,6 +386,13 @@ Pool.prototype.addWallet = function addWallet(w, defaultTs) {
|
|||||||
w.once('load', function(lastTs) { search(w.lastTs) });
|
w.once('load', function(lastTs) { search(w.lastTs) });
|
||||||
|
|
||||||
function search(ts) {
|
function search(ts) {
|
||||||
|
// Relay pending TXs
|
||||||
|
// NOTE: It is important to do it after search, because search could
|
||||||
|
// add TS to pending TXs, thus making them confirmed
|
||||||
|
w.pending().forEach(function(tx) {
|
||||||
|
self.sendTX(tx);
|
||||||
|
});
|
||||||
|
|
||||||
// Search for last week by default
|
// Search for last week by default
|
||||||
if (!ts)
|
if (!ts)
|
||||||
ts = defaultTs || ((+new Date / 1000) - 7 * 24 * 3600);
|
ts = defaultTs || ((+new Date / 1000) - 7 * 24 * 3600);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user