Skip to content

Commit 0f35ff3

Browse files
committed
allow low fees for unlock txes, add test
1 parent 2c6aa49 commit 0f35ff3

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/validation.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -981,6 +981,8 @@ static bool AcceptToMemoryPoolWithTime(const CChainParams& chainparams, CTxMemPo
981981
const CAmount nAbsurdFee, bool test_accept) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
982982
{
983983
std::vector<COutPoint> coins_to_uncache;
984+
// Let Asset Unlock tx into mempool ignoring all the limits
985+
bypass_limits = bypass_limits || (tx->nVersion == 3 && tx->nType == TRANSACTION_ASSET_UNLOCK);
984986
MemPoolAccept::ATMPArgs args { chainparams, state, nAcceptTime, bypass_limits, nAbsurdFee, coins_to_uncache, test_accept };
985987

986988
assert(std::addressof(::ChainstateActive()) == std::addressof(active_chainstate));

test/functional/feature_asset_locks.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,11 +300,13 @@ def run_test(self):
300300
asset_unlock_tx_too_late = self.create_assetunlock(103, COIN, pubkey)
301301
asset_unlock_tx_too_big_fee = self.create_assetunlock(104, COIN, pubkey, fee=int(Decimal("0.1") * COIN))
302302
asset_unlock_tx_zero_fee = self.create_assetunlock(105, COIN, pubkey, fee=0)
303+
asset_unlock_tx_low_fee = self.create_assetunlock(106, COIN, pubkey, fee=1)
303304
asset_unlock_tx_duplicate_index = copy.deepcopy(asset_unlock_tx)
304305
asset_unlock_tx_duplicate_index.vout[0].nValue += COIN
305306
too_late_height = node.getblock(node.getbestblockhash())["height"] + 48
306307

307308
self.check_mempool_result(tx=asset_unlock_tx, result_expected={'allowed': True})
309+
self.check_mempool_result(tx=asset_unlock_tx_low_fee, result_expected={'allowed': True})
308310
self.check_mempool_result(tx=asset_unlock_tx_too_big_fee,
309311
result_expected={'allowed': False, 'reject-reason' : 'absurdly-high-fee'})
310312
self.check_mempool_result(tx=asset_unlock_tx_zero_fee,

0 commit comments

Comments
 (0)