/* * This file is part of the Flowee project * Copyright (C) 2020-2023 Tom Zander * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ // Is this transaction a 'move between addresses' tx. // This is a heuristic and not available in the model, which is why its in the view. function isMoved(txInfo) { if (txInfo === null) return false if (txInfo.isCoinbase || txInfo.isFused || txInfo.fundsIn === 0 || txInfo.fundsOut === 0) return false var diff = txInfo.fundsOut - txInfo.fundsIn return diff < 0 && diff > -2500 // then the diff is likely just fees. } function historicalHeights() { return [ 100406, 105564, 111133, 115516, 120731, 127374, 133753, 138539, 142965, 147309, 150955, 155150, 159601, 164289, 168947, 173332, 177653, 182030, 186680, 191257, 196146, 200982, 205472, 210052, 214090, 218495, 223659, 228486, 233645, 238422, 243833, 248955, 254735, 260648, 266613, 272024, 277464, 282948, 288364, 292981, 298197, 303092, 308376, 312919, 317984, 322972, 327423, 332040, 336384, 340917, 345605, 349713, 354152, 358436, 362974, 367405, 371964, 376579, 380994, 385802, 390708, 395508, 400464, 404739, 409332, 413834, 418421, 422658, 427282, 431993, 436359, 441045, 445568, 450483, 455193, 459389, 463935, 468621, 473312, 478024, 484018, 489925, 499847, 506195, 510496, 514976, 519421, 523442, 527942, 532251, 536702, 541001, 545452, 549912, 554201, 558596, 562898, 567326, 571781, 575836, 580290, 584604, 589044, 593355, 597824, 602298, 606618, 611066, 615384, 619871, 624312, 628475, 632848, 637166, 641633, 645955, 650396, 654855, 659133, 663626, 667895, 672364, 676770, 680773, 685462, 689903, 694154, 698312, 702882, 707322, 711585, 716117, 720443, 724876, 729367, 733391, 737876, 742106, 746494, 750878, 755311, 759815, 764115, 768615, 772950, 777450, 781900, 758800, 790300, 794600, 799300, 803750, 808150, 812650, 817000, 821360, 825730, 830230, 834730, 839100, 843500, 847800, 852200, 856500, 861000, 865430, 869800, 874300, 878550, 882950, 887450, 891400, 895900, 900250, 904750, 909200, 913650, 918150, 922990 ]; } function heightOfBlockAtTime(dateTime) { let height = Pay.heightOfBlockAtTime(dateTime) // This is for the import page, an import can start before the // checkpoint we have, and without headers the above method will // not actually resolve. if (height <= 0) { // then we need to resolve it ourselves. // block-heights is one entry per month, first entry is Jan 2011 let baseline = new Date('2011-01-01') let index = (dateTime.getYear() - baseline.getYear()) * 12 + dateTime.getMonth() + 1 height = historicalHeights()[index - 1] } return height }