Log warning when unable to sign AccountAgeWitness.

This commit is contained in:
jmacxx 2023-09-19 13:07:32 -05:00
parent 1b26cffe7d
commit 1a010ec274
No known key found for this signature in database
GPG Key ID: 155297BABFE94A1B

View File

@ -744,18 +744,18 @@ public class AccountAgeWitnessService {
} }
public Optional<SignedWitness> traderSignAndPublishPeersAccountAgeWitness(Trade trade) { public Optional<SignedWitness> traderSignAndPublishPeersAccountAgeWitness(Trade trade) {
AccountAgeWitness peersWitness = findTradePeerWitness(trade).orElse(null);
Coin tradeAmount = trade.getAmount();
checkNotNull(trade.getProcessModel().getTradePeer().getPubKeyRing(), "Peer must have a keyring");
PublicKey peersPubKey = trade.getProcessModel().getTradePeer().getPubKeyRing().getSignaturePubKey();
checkNotNull(peersWitness, "Not able to find peers witness, unable to sign for trade {}",
trade.toString());
checkNotNull(tradeAmount, "Trade amount must not be null");
checkNotNull(peersPubKey, "Peers pub key must not be null");
try { try {
AccountAgeWitness peersWitness = findTradePeerWitness(trade).orElse(null);
Coin tradeAmount = trade.getAmount();
checkNotNull(trade.getProcessModel().getTradePeer().getPubKeyRing(), "Peer must have a keyring");
PublicKey peersPubKey = trade.getProcessModel().getTradePeer().getPubKeyRing().getSignaturePubKey();
checkNotNull(peersWitness, "Not able to find peers witness, unable to sign for trade {}",
trade.toString());
checkNotNull(tradeAmount, "Trade amount must not be null");
checkNotNull(peersPubKey, "Peers pub key must not be null");
return signedWitnessService.signAndPublishAccountAgeWitness(tradeAmount, peersWitness, peersPubKey); return signedWitnessService.signAndPublishAccountAgeWitness(tradeAmount, peersWitness, peersPubKey);
} catch (CryptoException e) { } catch (Exception e) {
log.warn("Trader failed to sign witness, exception {}", e.toString()); log.warn("Trader failed to sign witness, exception {}", e.toString());
} }
return Optional.empty(); return Optional.empty();