Merge pull request #3751 from mempool/mononaut/fix-rbf-times

Fix RBF timestamps to always use seconds
This commit is contained in:
softsimon 2023-05-11 19:35:29 -05:00 committed by GitHub
commit 7fca18d7be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,7 +36,7 @@ class RbfCache {
}
const newTx = Common.stripTransaction(newTxExtended) as RbfTransaction;
const newTime = newTxExtended.firstSeen || Date.now();
const newTime = newTxExtended.firstSeen || (Date.now() / 1000);
newTx.rbf = newTxExtended.vin.some((v) => v.sequence < 0xfffffffe);
this.txs.set(newTx.txid, newTxExtended);
@ -59,7 +59,7 @@ class RbfCache {
}
}
} else {
const replacedTime = replacedTxExtended.firstSeen || Date.now();
const replacedTime = replacedTxExtended.firstSeen || (Date.now() / 1000);
replacedTrees.push({
tx: replacedTx,
time: replacedTime,
@ -74,7 +74,7 @@ class RbfCache {
const treeId = replacedTrees[0].tx.txid;
const newTree = {
tx: newTx,
time: newTxExtended.firstSeen || Date.now(),
time: newTime,
fullRbf,
replaces: replacedTrees
};