Skip to content

Commit

Permalink
wallet: enable sending to silent payment address
Browse files Browse the repository at this point in the history
  • Loading branch information
josibake committed Sep 12, 2023
1 parent 66d708a commit 4537166
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
4 changes: 1 addition & 3 deletions src/addresstype.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,7 @@ class ValidDestinationVisitor
bool operator()(const PubKeyDestination& dest) const { return false; }
bool operator()(const PKHash& dest) const { return true; }
bool operator()(const ScriptHash& dest) const { return true; }
// silent payment addresses are not valid until sending support has been implemented
// TODO: set this to true once sending is implemented
bool operator()(const V0SilentPaymentDestination& dest) const { return false; }
bool operator()(const V0SilentPaymentDestination& dest) const { return true; }
bool operator()(const WitnessV0KeyHash& dest) const { return true; }
bool operator()(const WitnessV0ScriptHash& dest) const { return true; }
bool operator()(const WitnessV1Taproot& dest) const { return true; }
Expand Down
5 changes: 0 additions & 5 deletions src/key_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,6 @@ CTxDestination DecodeDestination(const std::string& str, const CChainParams& par
}
CPubKey scan_pubkey{data.begin(), data.begin() + CPubKey::COMPRESSED_SIZE};
CPubKey spend_pubkey{data.begin() + CPubKey::COMPRESSED_SIZE, data.begin() + 2*CPubKey::COMPRESSED_SIZE};
// This is a bit of a hack to disable silent payments until sending is implemented. The reason we return a V0SilentPaymentDestination
// while also setting an error message is so that we can use DecodeDestination in the unit tests, but also have `validateaddress` fail
// when passed a silent payment address
// TODO: remove this error_str once sending support is implemented
error_str = strprintf("This is a valid Silent Payments v0 address, but sending support is not yet implemented.");
return V0SilentPaymentDestination{scan_pubkey, spend_pubkey};
}
// Bech32 decoding
Expand Down

0 comments on commit 4537166

Please sign in to comment.