Add log message for the case where we match a script but do not have a matching address in our database (#4156)

This commit is contained in:
Chris Stewart 2022-03-03 11:15:35 -06:00 committed by GitHub
parent 4cefa56c99
commit f1bd0ea3a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -527,13 +527,21 @@ private[bitcoins] trait TransactionProcessing extends WalletLogger {
blockHashOpt: Option[DoubleSha256DigestBE]): Future[
Seq[SpendingInfoDb]] = {
val spks = outputsWithIndex.map(_.output.scriptPubKey).toVector
val addressDbsF: Future[Vector[AddressDb]] = {
getAddressDbs(outputsWithIndex.map(_.output.scriptPubKey).toVector)
getAddressDbs(spks)
}
val addressDbWithOutputF = for {
addressDbs <- addressDbsF
} yield matchAddressDbWithOutputs(addressDbs, outputsWithIndex.toVector)
} yield {
if (addressDbs.isEmpty) {
logger.warn(
s"Found zero addresses in the database to match an output we have a script for, txid=${transaction.txIdBE.hex} outputs=${outputsWithIndex}")
}
matchAddressDbWithOutputs(addressDbs, outputsWithIndex.toVector)
}
val nested = for {
addressDbWithOutput <- addressDbWithOutputF