From f1bef373a66be4da6dfb079dc504e36bf399ff1c Mon Sep 17 00:00:00 2001 From: Lev Berman Date: Wed, 8 Jan 2025 22:36:42 +0100 Subject: [PATCH] fixup --- apps/arweave/src/ar_serialize.erl | 2 +- apps/arweave/src/ar_wallet.erl | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/arweave/src/ar_serialize.erl b/apps/arweave/src/ar_serialize.erl index 32ccbc175..214705bac 100644 --- a/apps/arweave/src/ar_serialize.erl +++ b/apps/arweave/src/ar_serialize.erl @@ -670,7 +670,7 @@ encode_post_2_6_fields(#block{ height = Height, hash_preimage = HashPreimage, denomination = Denomination, redenomination_height = RedenominationHeight, double_signing_proof = DoubleSigningProof, previous_cumulative_diff = PrevCDiff } = B) -> - RewardKey = element(2, B#block.reward_key), + RewardKey = case B#block.reward_key of undefined -> <<>>; {_Type, Key} -> Key end, case Height >= ar_fork:height_2_6() of false -> <<>>; diff --git a/apps/arweave/src/ar_wallet.erl b/apps/arweave/src/ar_wallet.erl index 06276b46a..669676a2e 100644 --- a/apps/arweave/src/ar_wallet.erl +++ b/apps/arweave/src/ar_wallet.erl @@ -331,6 +331,8 @@ get_or_create_wallet([{_LastModified, F} | Entries], Types) -> get_or_create_wallet(Entries, Types) end. +recover_key(Data, <<>>, ?ECDSA_KEY_TYPE) -> + <<>>; recover_key(Data, Signature, ?ECDSA_KEY_TYPE) -> {_Pass, PubKey} = secp256k1_nif:ecrecover(Data, Signature), % Note. if Pass = false, then PubKey will be <<>>