Create witness outputs for (re)issueasset RPC

This commit is contained in:
Gregory Sanders 2020-02-24 09:32:21 -05:00
parent 53e1771cd8
commit 91583b6e0a

View file

@ -6223,7 +6223,7 @@ UniValue issueasset(const JSONRPCRequest& request)
if (!pwallet->GetKeyFromPool(newKey)) {
throw JSONRPCError(RPC_WALLET_KEYPOOL_RAN_OUT, "Error: Keypool ran out, please call keypoolrefill first");
}
asset_dest = PKHash(newKey.GetID());
asset_dest = WitnessV0KeyHash(newKey.GetID());
pwallet->SetAddressBook(asset_dest, "", "receive");
asset_dest_blindpub = pwallet->GetBlindingPubKey(GetScriptForDestination(asset_dest));
}
@ -6231,7 +6231,7 @@ UniValue issueasset(const JSONRPCRequest& request)
if (!pwallet->GetKeyFromPool(newKey)) {
throw JSONRPCError(RPC_WALLET_KEYPOOL_RAN_OUT, "Error: Keypool ran out, please call keypoolrefill first");
}
token_dest = PKHash(newKey.GetID());
token_dest = WitnessV0KeyHash(newKey.GetID());
pwallet->SetAddressBook(token_dest, "", "receive");
token_dest_blindpub = pwallet->GetBlindingPubKey(GetScriptForDestination(token_dest));
}
@ -6330,7 +6330,7 @@ UniValue reissueasset(const JSONRPCRequest& request)
if (!pwallet->GetKeyFromPool(newAssetKey)) {
throw JSONRPCError(RPC_WALLET_KEYPOOL_RAN_OUT, "Error: Keypool ran out, please call keypoolrefill first");
}
CTxDestination asset_dest = PKHash(newAssetKey.GetID());
CTxDestination asset_dest = WitnessV0KeyHash(newAssetKey.GetID());
pwallet->SetAddressBook(asset_dest, "", "receive");
CPubKey asset_dest_blindpub = pwallet->GetBlindingPubKey(GetScriptForDestination(asset_dest));
@ -6339,7 +6339,7 @@ UniValue reissueasset(const JSONRPCRequest& request)
if (!pwallet->GetKeyFromPool(newTokenKey)) {
throw JSONRPCError(RPC_WALLET_KEYPOOL_RAN_OUT, "Error: Keypool ran out, please call keypoolrefill first");
}
CTxDestination token_dest = PKHash(newTokenKey.GetID());
CTxDestination token_dest = WitnessV0KeyHash(newTokenKey.GetID());
pwallet->SetAddressBook(token_dest, "", "receive");
CPubKey token_dest_blindpub = pwallet->GetBlindingPubKey(GetScriptForDestination(token_dest));