Return empty if no PaymentAccountPayload is available

This commit is contained in:
Christoph Atteneder 2021-07-12 10:24:35 +02:00
parent dfb97ca05f
commit 75cc7633a3
No known key found for this signature in database
GPG Key ID: CD5DC1C529CDFD3B

View File

@ -285,6 +285,10 @@ public class AccountAgeWitnessService {
Optional<AccountAgeWitness> findWitness(PaymentAccountPayload paymentAccountPayload,
PubKeyRing pubKeyRing) {
if (paymentAccountPayload == null) {
return Optional.empty();
}
byte[] accountInputDataWithSalt = getAccountInputDataWithSalt(paymentAccountPayload);
byte[] hash = Hash.getSha256Ripemd160hash(Utilities.concatenateByteArrays(accountInputDataWithSalt,
pubKeyRing.getSignaturePubKeyBytes()));