Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.tap(([tail]) => {
if (!reference || !isAboveMaxDepth(reference.attachmentTimestamp, maxDepth)) {
reference = tail
} else {
return getConsistency([tail.hash]).then(consistent => {
if (!consistent) {
reference = tail
}
})
}
setTimeout(() => bundles.write(bundle), delay)
})
)