Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
hive
hive
Commits
7827098a
Commit
7827098a
authored
Aug 18, 2020
by
Bartek Wrona
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
effective_comment_vote_operation extended by total_vote_weight field.
parent
6cf2f52e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
libraries/chain/hive_evaluator.cpp
libraries/chain/hive_evaluator.cpp
+9
-3
libraries/protocol/include/hive/protocol/hive_virtual_operations.hpp
...rotocol/include/hive/protocol/hive_virtual_operations.hpp
+2
-1
No files found.
libraries/chain/hive_evaluator.cpp
View file @
7827098a
...
...
@@ -1785,6 +1785,9 @@ void pre_hf20_vote_evaluator( const vote_operation& o, database& _db )
c
.
total_vote_weight
+=
max_vote_weight
;
});
}
vop
.
total_vote_weight
=
comment_cashout
->
total_vote_weight
;
if
(
!
_db
.
has_hardfork
(
HIVE_HARDFORK_0_17__774
)
)
_db
.
adjust_rshares2
(
old_rshares
,
new_rshares
);
...
...
@@ -1890,6 +1893,7 @@ void pre_hf20_vote_evaluator( const vote_operation& o, database& _db )
});
effective_comment_vote_operation
vop
(
o
.
voter
,
o
.
author
,
o
.
permlink
);
vop
.
total_vote_weight
=
comment_cashout
->
total_vote_weight
;
_db
.
modify
(
*
itr
,
[
&
](
comment_vote_object
&
cv
)
{
...
...
@@ -2180,9 +2184,6 @@ void hf20_vote_evaluator( const vote_operation& o, database& _db )
vop
.
weight
=
newVote
.
weight
;
vop
.
rshares
=
newVote
.
rshares
;
_db
.
push_virtual_operation
(
vop
);
if
(
max_vote_weight
)
// Optimization
{
_db
.
modify
(
*
comment_cashout
,
[
&
](
comment_cashout_object
&
cc
)
...
...
@@ -2190,6 +2191,10 @@ void hf20_vote_evaluator( const vote_operation& o, database& _db )
cc
.
total_vote_weight
+=
max_vote_weight
;
});
}
vop
.
total_vote_weight
=
comment_cashout
->
total_vote_weight
;
_db
.
push_virtual_operation
(
vop
);
}
else
{
...
...
@@ -2284,6 +2289,7 @@ void hf20_vote_evaluator( const vote_operation& o, database& _db )
});
effective_comment_vote_operation
vop
(
o
.
voter
,
o
.
author
,
o
.
permlink
);
vop
.
total_vote_weight
=
comment_cashout
->
total_vote_weight
;
vop
.
weight
=
vote
.
weight
;
vop
.
rshares
=
vote
.
rshares
;
_db
.
push_virtual_operation
(
vop
);
...
...
libraries/protocol/include/hive/protocol/hive_virtual_operations.hpp
View file @
7827098a
...
...
@@ -163,6 +163,7 @@ namespace hive { namespace protocol {
string
permlink
;
uint64_t
weight
=
0
;
///< defines the score this vote receives, used by vote payout calc. 0 if a negative vote or changed votes.
int64_t
rshares
=
0
;
///< The number of rshares this vote is responsible for
uint64_t
total_vote_weight
=
0
;
///< the total weight of voting rewards, used to calculate pro-rata share of curation payouts
//potential payout of related comment at the moment of this vote
asset
pending_payout
=
asset
(
0
,
HBD_SYMBOL
);
//supplemented by account history RocksDB plugin (needed by HiveMind)
};
...
...
@@ -291,7 +292,7 @@ FC_REFLECT( hive::protocol::fill_order_operation, (current_owner)(current_orderi
FC_REFLECT
(
hive
::
protocol
::
fill_transfer_from_savings_operation
,
(
from
)(
to
)(
amount
)(
request_id
)(
memo
)
)
FC_REFLECT
(
hive
::
protocol
::
hardfork_operation
,
(
hardfork_id
)
)
FC_REFLECT
(
hive
::
protocol
::
comment_payout_update_operation
,
(
author
)(
permlink
)
)
FC_REFLECT
(
hive
::
protocol
::
effective_comment_vote_operation
,
(
voter
)(
author
)(
permlink
)(
weight
)(
rshares
)(
pending_payout
))
FC_REFLECT
(
hive
::
protocol
::
effective_comment_vote_operation
,
(
voter
)(
author
)(
permlink
)(
weight
)(
rshares
)(
total_vote_weight
)(
pending_payout
))
FC_REFLECT
(
hive
::
protocol
::
ineffective_delete_comment_operation
,
(
author
)(
permlink
))
FC_REFLECT
(
hive
::
protocol
::
return_vesting_delegation_operation
,
(
account
)(
vesting_shares
)
)
FC_REFLECT
(
hive
::
protocol
::
comment_benefactor_reward_operation
,
(
benefactor
)(
author
)(
permlink
)(
hbd_payout
)(
hive_payout
)(
vesting_payout
)
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment