Closed dsaveliev closed 5 years ago
GetVirtualTransactionSize must have a sigOpCost as an argument. Right now this test passes just by coincidence.
I think it's not coincidental that the test passes, since the scripts used in the test have a sigop cost of 0 anyway. It doesn't hurt to add the parameter, but Bitcoin doesn't have it, so maybe we should keep everything as it is?
Although this PR is quite small, I think we should separate the fix to the p2p_fingerprint
test from the style changes.
I think it's not coincidental that the test passes, since the scripts used in the test have a sigop cost of 0 anyway. It doesn't hurt to add the parameter, but Bitcoin doesn't have it, so maybe we should keep everything as it is?
Not quite, TestMemPoolEntryHelper
is initialized with sigOpCost = 4
:
https://github.com/dtr-org/unit-e/blob/c85d170adbe575b94000d0be3b5b9fb5f238740f/src/test/test_unite.h#L122
which goes further to CTxMemPoolEntry
https://github.com/dtr-org/unit-e/blob/c85d170adbe575b94000d0be3b5b9fb5f238740f/src/test/test_unite.cpp#L169
which finally affects indexed_transaction_set
https://github.com/dtr-org/unit-e/blob/c85d170adbe575b94000d0be3b5b9fb5f238740f/src/txmempool.cpp#L100
and finally affects the TX order.
So, here we have a green test just because of fee based on nWeight
, which match to the value, calculated inside of indexed_transaction_set
:
https://github.com/dtr-org/unit-e/blob/365cf0d4b5d580f5a202b519ab316ac1ea28cf0a/src/policy/policy.cpp#L265
During the #1062 a couple of minor problems was found:
GetVirtualTransactionSize
must have asigOpCost
as an argument. Right now this test passes just by coincidence.p2p_fingerprint.py
we need to take unspent coins before the substituted subchain.Signed-off-by: Dmitry Saveliev dima@thirdhash.com