try
This commit is contained in:
@@ -4973,18 +4973,16 @@ UniValue setpubkey(const UniValue& params, bool fHelp)
|
|||||||
+ HelpExampleRpc("setpubkey", "02f7597468703c1c5c8465dd6d43acaae697df9df30bed21494d193412a1ea193e")
|
+ HelpExampleRpc("setpubkey", "02f7597468703c1c5c8465dd6d43acaae697df9df30bed21494d193412a1ea193e")
|
||||||
);
|
);
|
||||||
|
|
||||||
char address[20];
|
char address[18];
|
||||||
extern uint8_t NOTARY_PUBKEY33[];
|
extern uint8_t NOTARY_PUBKEY33[];
|
||||||
extern std::string NOTARY_PUBKEY;
|
extern std::string NOTARY_PUBKEY;
|
||||||
if ( NOTARY_PUBKEY33[0] == 0 && strlen(params[0].get_str().c_str()) == 66 ) {
|
if ( NOTARY_PUBKEY33[0] == 0 && strlen(params[0].get_str().c_str()) == 66 ) {
|
||||||
LOCK(cs_main);
|
//LOCK(cs_main);
|
||||||
NOTARY_PUBKEY = params[0].get_str();
|
NOTARY_PUBKEY = params[0].get_str();
|
||||||
decode_hex(NOTARY_PUBKEY33,33,(char *)NOTARY_PUBKEY.c_str());
|
decode_hex(NOTARY_PUBKEY33,33,(char *)NOTARY_PUBKEY.c_str());
|
||||||
pubkey2addr((char *)address,(uint8_t *)NOTARY_PUBKEY33);
|
pubkey2addr((char *)address,(uint8_t *)NOTARY_PUBKEY33);
|
||||||
printf("%s\n",address);
|
printf("%s\n",address);
|
||||||
std::string str(address);
|
result.push_back(Pair("R-address", address));
|
||||||
cout << str;
|
|
||||||
//result.push_back(Pair("R-address", str));
|
|
||||||
} else {
|
} else {
|
||||||
result.push_back(Pair("error", "Can only set pubkey once, to change it you need to restart your daemon."));
|
result.push_back(Pair("error", "Can only set pubkey once, to change it you need to restart your daemon."));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user