Skip to content

Commit

Permalink
wallet: Use nVersion field to determine the transaction version
Browse files Browse the repository at this point in the history
  • Loading branch information
lateminer committed May 13, 2024
1 parent 5cd7248 commit b3dd180
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/wallet/spend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,8 @@ TxSize CalculateMaximumSignedTxSize(const CTransaction &tx, const CWallet *walle
if (is_segwit) weight += 2;

// Blackcoin: transaction weight should be increased for v1 transactions because of additional nTime field
// We assume that v1 transactions have nTime > 0
bool is_old_tx = tx.nTime > 0;
if (is_old_tx) weight += 4 * WITNESS_SCALE_FACTOR;
if (tx.nVersion < 2)
weight += 4 * WITNESS_SCALE_FACTOR;

// Add the size of the transaction outputs.
for (const auto& txo : tx.vout) weight += GetSerializeSize(txo, PROTOCOL_VERSION) * WITNESS_SCALE_FACTOR;
Expand Down

0 comments on commit b3dd180

Please sign in to comment.