add custom fee, fix position of incoming_tx #28

Merged
duke merged 8 commits from lucretius/silentdragonlite-cli:dev into dev 4 months ago
Collaborator

This PR allows the setting of custom fees for transactions in sdl. It also fixes a problem with the position of the incoming_metadata, which is why some users could not see some messages from the mempool.

This PR allows the setting of custom fees for transactions in sdl. It also fixes a problem with the position of the incoming_metadata, which is why some users could not see some messages from the mempool.
lucretius added 4 commits 4 months ago
Owner

@lucretius I have a question about this code:

        for (_, _, _, fee) in send_args.iter() {
            if *fee != default_fee {
                total_fee = *fee;
                break;  
            }
        }

If it's calculating a "total fee" should that be += instead of = ?

@lucretius I have a question about this code: ``` for (_, _, _, fee) in send_args.iter() { if *fee != default_fee { total_fee = *fee; break; } } ``` If it's calculating a "total fee" should that be `+=` instead of `=` ?
Poster
Collaborator

@lucretius I have a question about this code:

        for (_, _, _, fee) in send_args.iter() {
            if *fee != default_fee {
                total_fee = *fee;
                break;  
            }
        }

If it's calculating a "total fee" should that be += instead of = ?

@duke
The name total_fee might be misleading since the logic of the code is not actually calculating a "total" of all fees. Instead, it is finding the first fee value that differs from the default and using that as the fee for the operation. A more appropriate name for the variable might be applicable_fee or selected_fee, as it better reflects its purpose in the code. You are right

> @lucretius I have a question about this code: > > ``` > for (_, _, _, fee) in send_args.iter() { > if *fee != default_fee { > total_fee = *fee; > break; > } > } > ``` > > If it's calculating a "total fee" should that be `+=` instead of `=` ? @duke The name total_fee might be misleading since the logic of the code is not actually calculating a "total" of all fees. Instead, it is finding the first fee value that differs from the default and using that as the fee for the operation. A more appropriate name for the variable might be applicable_fee or selected_fee, as it better reflects its purpose in the code. You are right
lucretius added 1 commit 4 months ago
lucretius added 1 commit 4 months ago
lucretius added 1 commit 4 months ago
lucretius added 1 commit 4 months ago
Poster
Collaborator

@duke i changed the name to selected_fee to better reflect what it is for, and i fixed a copy pasta error in the name (superfluous ,)

@duke i changed the name to selected_fee to better reflect what it is for, and i fixed a copy pasta error in the name (superfluous ,)
duke merged commit 8fc0dc539a into dev 4 months ago
The pull request has been merged as 8fc0dc539a.
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This pull request currently doesn't have any dependencies.

Loading…
There is no content yet.