Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for exchange address implementation #1375

Merged
merged 3 commits into from
Dec 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ class CTestNetParams : public CChainParams {

base58Prefixes[PUBKEY_ADDRESS] = std::vector < unsigned char > (1, 65);
base58Prefixes[SCRIPT_ADDRESS] = std::vector < unsigned char > (1, 178);
base58Prefixes[EXCHANGE_PUBKEY_ADDRESS] = {0x01, 0xb9, 0xbb}; // EXT prefix for the address
base58Prefixes[EXCHANGE_PUBKEY_ADDRESS] = {0x01, 0xb9, 0xb1}; // EXT prefix for the address
base58Prefixes[SECRET_KEY] = std::vector < unsigned char > (1, 185);
base58Prefixes[EXT_PUBLIC_KEY] = boost::assign::list_of(0x04)(0x35)(0x87)(0xCF).convert_to_container < std::vector < unsigned char > > ();
base58Prefixes[EXT_SECRET_KEY] = boost::assign::list_of(0x04)(0x35)(0x83)(0x94).convert_to_container < std::vector < unsigned char > > ();
Expand Down
2 changes: 1 addition & 1 deletion src/spark/sparkwallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1231,7 +1231,7 @@ CWalletTx CSparkWallet::CreateSparkSpendTransaction(
auto& recipient = recipients[i];

if (recipient.scriptPubKey.IsPayToExchangeAddress()) {
throw std::runtime_error("Cannot create private transaction with exchange address as a destination");
throw std::runtime_error("Exchange addresses cannot receive private funds. Please transfer your funds to a transparent address first before sending to an Exchange address");
}

if (!MoneyRange(recipient.nAmount)) {
Expand Down
2 changes: 1 addition & 1 deletion src/wallet/lelantusjoinsplitbuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ CWalletTx LelantusJoinSplitBuilder::Build(
auto& recipient = recipients[i];

if (recipient.scriptPubKey.IsPayToExchangeAddress()) {
throw std::runtime_error("Cannot create private transaction with exchange address as a destination");
throw std::runtime_error("Exchange addresses cannot receive private funds. Please transfer your funds to a transparent address first before sending to an Exchange address");
}

if (!MoneyRange(recipient.nAmount)) {
Expand Down
2 changes: 2 additions & 0 deletions src/wallet/rpcwallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,8 @@ UniValue getnewexchangeaddress(const JSONRPCRequest& request)
CBitcoinAddress newAddress;
newAddress.SetExchange(keyID);

pwallet->SetAddressBook(newAddress.Get(), "", "receive");

return newAddress.ToString();
}

Expand Down
Loading