Fixes for blockbook API
This commit is contained in:
parent
af98050cd4
commit
01cf723a96
@ -39,7 +39,7 @@ function confirmDepositFLO() {
|
|||||||
verifyTx.FLO = function (sender, txid, group) {
|
verifyTx.FLO = function (sender, txid, group) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
floBlockchainAPI.getTx(txid).then(tx => {
|
floBlockchainAPI.getTx(txid).then(tx => {
|
||||||
let vin_sender = tx.vin.filter(v => v.addr === sender)
|
let vin_sender = tx.vin.filter(v => v.addresses[0] === sender)
|
||||||
if (!vin_sender.length)
|
if (!vin_sender.length)
|
||||||
return reject([true, "Transaction not sent by the sender"]);
|
return reject([true, "Transaction not sent by the sender"]);
|
||||||
if (vin_sender.length !== tx.vin.length)
|
if (vin_sender.length !== tx.vin.length)
|
||||||
@ -213,9 +213,10 @@ function processAll() {
|
|||||||
var lastSyncBlockHeight = 0;
|
var lastSyncBlockHeight = 0;
|
||||||
|
|
||||||
function periodicProcess() {
|
function periodicProcess() {
|
||||||
floBlockchainAPI.promisedAPI('api/blocks?limit=1').then(result => {
|
floBlockchainAPI.promisedAPI('api/status').then(result => {
|
||||||
if (lastSyncBlockHeight < result.blocks[0].height) {
|
let blockbook_height = result.blockbook.bestHeight;
|
||||||
lastSyncBlockHeight = result.blocks[0].height;
|
if (lastSyncBlockHeight < blockbook_height) {
|
||||||
|
lastSyncBlockHeight = blockbook_height;
|
||||||
processAll();
|
processAll();
|
||||||
console.log("Last Block :", lastSyncBlockHeight);
|
console.log("Last Block :", lastSyncBlockHeight);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user