commit
37f8b6db9f
|
@ -17,16 +17,21 @@ module.exports.init = function(app, io_ext) {
|
|||
|
||||
module.exports.broadcastTx = function(tx) {
|
||||
if (ios) {
|
||||
var t = {};
|
||||
var t;
|
||||
if (typeof tx === 'string') {
|
||||
t = {
|
||||
txid: tx
|
||||
};
|
||||
} else {
|
||||
t = tx;
|
||||
}
|
||||
|
||||
else {
|
||||
t = {
|
||||
txid: tx.txid,
|
||||
size: tx.size,
|
||||
};
|
||||
// Outputs
|
||||
var valueOut = 0;
|
||||
t.vout.forEach(function(o) {
|
||||
tx.vout.forEach(function(o) {
|
||||
valueOut += o.value * util.COIN;
|
||||
});
|
||||
|
||||
|
|
|
@ -53,7 +53,9 @@ if (!config.disableP2pSync) {
|
|||
/**
|
||||
* historic_sync process
|
||||
*/
|
||||
var historicSync = new HistoricSync({ shouldBroadcastSync: true });
|
||||
var historicSync = new HistoricSync({
|
||||
shouldBroadcastSync: true
|
||||
});
|
||||
peerSync.historicSync = historicSync;
|
||||
|
||||
if (!config.disableHistoricSync) {
|
||||
|
|
|
@ -264,7 +264,12 @@ function spec() {
|
|||
self.connectedCountDB > self.blockChainHeight * 0.9) return next();
|
||||
|
||||
|
||||
try {
|
||||
self.blockExtractor = new BlockExtractor(config.bitcoind.dataDir, config.network);
|
||||
} catch (e) {
|
||||
p(e.message + '. Disabling file sync.');
|
||||
return next();
|
||||
}
|
||||
|
||||
self.getFn = self.getBlockFromFile;
|
||||
self.allowReorgs = true;
|
||||
|
@ -407,6 +412,7 @@ function spec() {
|
|||
else {
|
||||
self.endTs = Date.now();
|
||||
self.status = 'finished';
|
||||
console.log('Done Syncing', self.info());
|
||||
return w_cb(err);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -18,7 +18,9 @@ program
|
|||
.option('-v --verbose', 'Verbose 0/1', 0)
|
||||
.parse(process.argv);
|
||||
|
||||
var historicSync = new HistoricSync();
|
||||
var historicSync = new HistoricSync({
|
||||
shouldBroadcastSync: true,
|
||||
});
|
||||
|
||||
|
||||
async.series([
|
||||
|
|
Loading…
Reference in New Issue