Do not create transactions with incorrect claims #192

Merged
bvbfan merged 1 commit from verify_claimid into master 2018-09-04 15:17:48 +02:00
bvbfan commented 2018-08-20 16:45:01 +02:00 (Migrated from github.com)

Signed-off-by: Anthony Fieroni bvbfan@abv.bg

Signed-off-by: Anthony Fieroni <bvbfan@abv.bg>
kaykurokawa (Migrated from github.com) reviewed 2018-08-20 16:45:01 +02:00
bvbfan commented 2018-08-20 16:47:41 +02:00 (Migrated from github.com)
https://github.com/lbryio/lbrycrd/issues/116
kaykurokawa (Migrated from github.com) reviewed 2018-08-21 04:11:41 +02:00
@ -426,6 +426,10 @@ UniValue claimname(const UniValue& params, bool fHelp)
);
kaykurokawa (Migrated from github.com) commented 2018-08-21 04:11:40 +02:00

while it is unintuitive, an empty claim name is actually valid (you can make claim for empty names when you use double quotes: "" in the RPC claimname command) so this check is not needed

while it is unintuitive, an empty claim name is actually valid (you can make claim for empty names when you use double quotes: "" in the RPC claimname command) so this check is not needed
kaykurokawa (Migrated from github.com) reviewed 2018-08-21 04:13:02 +02:00
@ -849,2 +860,4 @@
string sName = params[0].get_str();
string sClaimId = params[1].get_str();
const size_t claimLength = 40;
kaykurokawa (Migrated from github.com) commented 2018-08-21 04:13:02 +02:00

same here

same here
kaykurokawa (Migrated from github.com) reviewed 2018-08-21 04:15:32 +02:00
@ -849,2 +860,4 @@
string sName = params[0].get_str();
string sClaimId = params[1].get_str();
const size_t claimLength = 40;
kaykurokawa (Migrated from github.com) commented 2018-08-21 04:15:31 +02:00

There is actually a function created to check claimId here:
https://github.com/lbryio/lbrycrd/blob/master/src/rpc/claimtrie.cpp#L10

There is actually a function created to check claimId here: https://github.com/lbryio/lbrycrd/blob/master/src/rpc/claimtrie.cpp#L10
kaykurokawa (Migrated from github.com) reviewed 2018-08-21 04:20:49 +02:00
@ -536,1 +544,4 @@
{
if (op == OP_SUPPORT_CLAIM)
continue;
kaykurokawa (Migrated from github.com) commented 2018-08-21 04:20:49 +02:00

good catch.. I think this would have been problematic if the decoded claim script was a support...

good catch.. I think this would have been problematic if the decoded claim script was a support...
bvbfan commented 2018-08-21 09:32:36 +02:00 (Migrated from github.com)

rpc/claimtrie.cpp is a part of libbitcoin_server while rpcwallet of libbitcoin_wallet that's why i'm including only 2 checks from ParseClaimtrieId not compete one.

rpc/claimtrie.cpp is a part of libbitcoin_server while rpcwallet of libbitcoin_wallet that's why i'm including only 2 checks from ParseClaimtrieId not compete one.
lbrynaut (Migrated from github.com) requested changes 2018-08-29 20:18:02 +02:00
lbrynaut (Migrated from github.com) left a comment

Please fix the travis issue.

Please fix the travis issue.
lbrynaut (Migrated from github.com) commented 2018-08-29 19:50:26 +02:00

"value must be hexadecimal" or something like that is a fine description (typos above: contains, hexdecimal, also omit the omit warning)

"value must be hexadecimal" or something like that is a fine description (typos above: contains, hexdecimal, also omit the omit warning)
lbrynaut (Migrated from github.com) commented 2018-08-29 19:50:49 +02:00

Same as above, just a wording difference/typo fix.

Same as above, just a wording difference/typo fix.
lbrynaut (Migrated from github.com) commented 2018-08-29 19:52:36 +02:00
if (op == OP_SUPPORT_CLAIM)
    continue;
``` if (op == OP_SUPPORT_CLAIM) continue; ```
lbrynaut (Migrated from github.com) commented 2018-08-29 19:53:18 +02:00

Reverse these (non-standard style otherwise)

Reverse these (non-standard style otherwise)
lbrynaut (Migrated from github.com) commented 2018-08-29 19:57:58 +02:00

Since 40 is not declared as a fixed constexpr, but used as a fixed constexpr, either declare it as something const (not constexpr since not C++11) and use that, or just change this to something like:

"claimid must be of length 40"
Since 40 is not declared as a fixed constexpr, but used as a fixed constexpr, either declare it as something const (not constexpr since not C++11) and use that, or just change this to something like: ``` "claimid must be of length 40" ```
bvbfan commented 2018-08-30 09:35:01 +02:00 (Migrated from github.com)

Fix addressed issues.

Fix addressed issues.
bvbfan commented 2018-08-30 09:43:28 +02:00 (Migrated from github.com)

Mac build looks broken again.

Mac build looks broken again.
lbrynaut (Migrated from github.com) reviewed 2018-08-30 19:53:36 +02:00
lbrynaut (Migrated from github.com) left a comment

Untested, but looks good to me, pending a travis build fix.

Untested, but looks good to me, pending a travis build fix.
lbrynaut (Migrated from github.com) approved these changes 2018-08-30 19:53:50 +02:00
lbrynaut (Migrated from github.com) requested changes 2018-08-30 19:58:02 +02:00
lbrynaut (Migrated from github.com) left a comment

I'll leave this on 'request changes' instead of 'approve' until the travis issue is resolved.

I'll leave this on 'request changes' instead of 'approve' until the travis issue is resolved.
BrannonKing commented 2018-08-30 22:33:23 +02:00 (Migrated from github.com)

Rebase off master again and the OSX build will be fixed.

Rebase off master again and the OSX build will be fixed.
bvbfan commented 2018-08-31 11:44:30 +02:00 (Migrated from github.com)

Done

Done
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbrycrd#192
No description provided.