Skip to content

Commit

Permalink
don't try to decode invalid encoded ext keys
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasschnelli authored and str4d committed Mar 3, 2017
1 parent 5187877 commit 4d1d953
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/base58.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,10 @@ template<typename K, int Size, CChainParams::Base58Type Type> class CBitcoinExtK

K GetKey() {
K ret;
ret.Decode(&vchData[0]);
if (vchData.size() == Size) {
//if base58 encouded data not holds a ext key, return a !IsValid() key
ret.Decode(&vchData[0]);
}
return ret;
}

Expand Down

0 comments on commit 4d1d953

Please sign in to comment.