Skip to content

Commit

Permalink
txns priority changed
Browse files Browse the repository at this point in the history
  • Loading branch information
OsauravO committed Apr 27, 2024
1 parent e862c5d commit bee65d0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,11 +333,11 @@ func Ordering() (uint64, []string, []string) {

var reward uint64 = 0
var allowedTxs []TxInfo
var maxWeight uint64 = 3999300
var targetScore uint64 = 108 // Target score around 108
var maxWeight uint64 = 4000000
var targetScore uint64 = 108

for _, tx := range txInfo {
if maxWeight >= tx.Weight && reward+tx.Fee <= targetScore*maxWeight/100 {
if maxWeight >= tx.Weight && float64(reward+tx.Fee)/float64(maxWeight) <= float64(targetScore)/100.0 {
allowedTxs = append(allowedTxs, tx)
maxWeight -= tx.Weight
allowedTxIDs = append(allowedTxIDs, tx.TxID)
Expand Down
7 changes: 4 additions & 3 deletions output.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
070000000000000000000000000000000000000000000000000000000000000000000000396a61d81146e6945d5b45a20609ecc74ce76cc81c272af955d50634682c1f472cb62c66ffff001f5bc10000
010000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff1b03951a0604f15ccf5609013803062b9b5a0100072f425443432f20ffffffff0253ff3f0000000000160014df4bf9f3621073202be59ae590f55f42879a21a00000000000000000266a24aa21a9edf25ee443061d57a2312fc3ab7720d2ed366d325a435fda70e3a0a78bf94fe8c80120000000000000000000000000000000000000000000000000000000000000000000000000
3db4c6b94ff5bf7e7b30a684e68ca4bffb388073ea12551582a126b83657effa
07000000000000000000000000000000000000000000000000000000000000000000000045cd2179dea750c5a9dff487f48c99cf792980e32c661c369b6100a16e1482f279c02c66ffff001f62bc0000
010000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff1b03951a0604f15ccf5609013803062b9b5a0100072f425443432f20ffffffff025b02400000000000160014df4bf9f3621073202be59ae590f55f42879a21a00000000000000000266a24aa21a9edd70cbd2cf75eb4d3509780058eba615838710eccce5924f5497547a35b0de15e0120000000000000000000000000000000000000000000000000000000000000000000000000
c2936fba1a5696f17840e0bf42a4a866cfb149323ec0839f5b8805589599d4d7
82f9f96db7bdbb9e70626747632e373b34eefd50d613dfea7092744169591b6e
7cb2a4f55245bae141a5d6ad51c08d7a9fdf2c2b905e4d97639ed80b82e69800
a9e537569db3c64340ed5abcdd983e9bb1b6ad6f90c93bc80d31c5cc0490bcea
Expand Down Expand Up @@ -121,3 +121,4 @@ b5e9ec2fac3a9dd54e2dab079130f16466ac56cbedaa3a5e0340ae6cbdddb034
19c40dff6bfee010ca3d3f41461b540109ec1d5d9fbb70584810eb2e4226666c
695ee155ab71adde88b72d58cbbfa6f83bdf2cb79a151f248abea26dca04e88d
90c32b1af80079f25601acfa9357e8f5a4593f85b2b13da93b7bf4b64ec98bbc
5ae95728013d96066aa5f5769a04f8b23bd69320ecf3372cbb61187dea723783

0 comments on commit bee65d0

Please sign in to comment.