aboutsummaryrefslogtreecommitdiff
path: root/src/util/message.h
Commit message (Collapse)AuthorAgeFilesLines
* Move direct calls to MessageSign into new SignMessage functions in CWallet ↵Andrew Chow2020-03-091-0/+8
| | | | | | | and ScriptPubKeyMan Instead of getting a SigningProvider and then going to MessageSign, have ScriptPubKeyMan handle the message signing internally.
* Refactor message hashing into a utility functionJeffrey Czyz2020-02-141-1/+8
| | | | | | | | | And add unit test for it. The purpose of using a preamble or "magic" text as part of signing and verifying a message was not given when the code was repeated in a few locations. Make a test showing how it is used to prevent inadvertently signing a transaction.
* Deduplicate the message signing codeVasil Dimov2020-02-141-0/+12
| | | | | | | | | | | | | | | | | | | | The logic of signing a message was duplicated in 3 places: src/qt/signverifymessagedialog.cpp SignVerifyMessageDialog::on_signMessageButton_SM_clicked() src/rpc/misc.cpp signmessagewithprivkey() src/wallet/rpcwallet.cpp signmessage() Move the logic into src/util/message.cpp MessageSign() and call it from all the 3 places.
* Deduplicate the message verifying codeVasil Dimov2020-02-141-0/+49
The logic of verifying a message was duplicated in 2 places: src/qt/signverifymessagedialog.cpp SignVerifyMessageDialog::on_verifyMessageButton_VM_clicked() src/rpc/misc.cpp verifymessage() with the only difference being the result handling. Move the logic into a dedicated src/util/message.cpp MessageVerify() which returns a set of result codes, call it from the 2 places and just handle the results differently in the callers.