Skip to content

Commit

Permalink
wallet: Take into account nTime field when calculating transaction we…
Browse files Browse the repository at this point in the history
…ight
  • Loading branch information
lateminer committed Feb 3, 2024
1 parent c67b18b commit f084b4e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/wallet/spend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ TxSize CalculateMaximumSignedTxSize(const CTransaction &tx, const CWallet *walle
// Segwit marker and flag
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;

// 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 f084b4e

Please sign in to comment.