Skip to content

Commit 7cb1f9f

Browse files
committed
fix and extend CBitcoinExtKeyBase template
- fix Decode call (req. only one param) - add constructor for base58c->CExtKey
1 parent 633fe10 commit 7cb1f9f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/base58.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,18 @@ template<typename K, int Size, CChainParams::Base58Type Type> class CBitcoinExtK
146146

147147
K GetKey() {
148148
K ret;
149-
ret.Decode(&vchData[0], &vchData[Size]);
149+
ret.Decode(&vchData[0]);
150150
return ret;
151151
}
152152

153153
CBitcoinExtKeyBase(const K &key) {
154154
SetKey(key);
155155
}
156156

157+
CBitcoinExtKeyBase(const std::string& strBase58c) {
158+
SetString(strBase58c.c_str(), Params().Base58Prefix(Type).size());
159+
}
160+
157161
CBitcoinExtKeyBase() {}
158162
};
159163

0 commit comments

Comments
 (0)