Last active
January 26, 2018 12:53
-
-
Save brkphp/509ea713fd89ec990ebdef566d19e2cb to your computer and use it in GitHub Desktop.
iota rebroadcast
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var IOTA; | |
const IOTA = require('iota.lib.js'); | |
var tx = "yourtx" | |
const iota = new IOTA({ | |
'host': 'http://iri4.iota.fm', | |
'port': 80 | |
}); | |
function rebroadcast(iotajs,tx){ | |
console.log('rebroadcasting ' + tx + ' ..'); | |
iotajs.api.broadcastBundle(tx,function(err, success) { | |
if (!err) { | |
console.log('Successfully rebroadcast: ' + tx); | |
}else { | |
console.log(err); | |
if (err != 'Error: Invalid tail transaction supplied.' || err != 'Error: Invalid Bundle provided') { | |
rebroadcast(iotajs, tx); | |
} | |
} | |
}); | |
} | |
rebroadcast(iota, tx); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment