mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-13 16:48:08 +00:00
Used SegWit address for keva_put.
This commit is contained in:
parent
bf62b97a6a
commit
0fa3dfbcc0
@ -268,11 +268,10 @@ UniValue keva_put(const JSONRPCRequest& request)
|
|||||||
CPubKey pubKeyReserve;
|
CPubKey pubKeyReserve;
|
||||||
const bool ok = keyName.GetReservedKey(pubKeyReserve, true);
|
const bool ok = keyName.GetReservedKey(pubKeyReserve, true);
|
||||||
assert(ok);
|
assert(ok);
|
||||||
bool usedKey = false;
|
CKeyID keyId = pubKeyReserve.GetID();
|
||||||
|
CScript redeemScript = GetScriptForDestination(WitnessV0KeyHash(keyId));
|
||||||
CScript addrName;
|
CScriptID scriptHash = CScriptID(redeemScript);
|
||||||
usedKey = true;
|
CScript addrName = GetScriptForDestination(scriptHash);
|
||||||
addrName = GetScriptForDestination(pubKeyReserve.GetID());
|
|
||||||
|
|
||||||
const CScript kevaScript = CKevaScript::buildKevaPut(addrName, nameSpace, key, value);
|
const CScript kevaScript = CKevaScript::buildKevaPut(addrName, nameSpace, key, value);
|
||||||
|
|
||||||
@ -282,10 +281,7 @@ UniValue keva_put(const JSONRPCRequest& request)
|
|||||||
SendMoneyToScript(pwallet, kevaScript, &txIn, empty,
|
SendMoneyToScript(pwallet, kevaScript, &txIn, empty,
|
||||||
KEVA_LOCKED_AMOUNT, false, wtx, coinControl);
|
KEVA_LOCKED_AMOUNT, false, wtx, coinControl);
|
||||||
|
|
||||||
if (usedKey) {
|
keyName.KeepKey();
|
||||||
keyName.KeepKey ();
|
|
||||||
}
|
|
||||||
|
|
||||||
return wtx.GetHash().GetHex();
|
return wtx.GetHash().GetHex();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user