INSUFFICIENT PRIORITY message is not triggered

+3 votes

Hi MC team,

I tried to trigger INSUFFICIENT PRIORITY message by sending a transaction with 0 fee or fee under the total cost of the transaction. Here is the procedure:
1. select UTXO

listunspent 0 99999 '["17Wjvi4uhP92zsMgxd36oPxgkCK27FYbnY"]'

    {
        "txid" : "070c8f0e6180cd85c4f5e07fe7e7a2413f69e67941e39f8230a950477c39bc0e",
        "vout" : 0,
        "address" : "17Wjvi4uhP92zsMgxd36oPxgkCK27FYbnY",
        "account" : "",
        "scriptPubKey" : "76a9144770a681a423cf9f5a1cc5566d20528d0986e0c188ac",
        "amount" : 0.2,
        "confirmations" : 634,
        "cansend" : true,
        "spendable" : false,
        "assets" : [
        ],
        "permissions" : [
        ]
    }


    {
        "txid" : "3417dbcd3a1546556934a09852829abb57652d3df97ab5cc2264c756f19d0d7f",
        "vout" : 1,
        "address" : "17Wjvi4uhP92zsMgxd36oPxgkCK27FYbnY",
        "account" : "",
        "scriptPubKey" : "76a9144770a681a423cf9f5a1cc5566d20528d0986e0c188ac0c73706b67010000000000000075",
        "amount" : 0,
        "confirmations" : 908,
        "cansend" : true,
        "spendable" : false,
        "assets" : [
            {
                "name" : "asset_4",
                "assetref" : "192-301-5940",
                "qty" : 1
            }
        ],
        "permissions" : [
        ]
    }

2. createrawtransaction
createrawtransaction '[{"txid":"070c8f0e6180cd85c4f5e07fe7e7a2413f69e67941e39f8230a950477c39bc0e","vout":0},{"txid":"3417dbcd3a1546556934a09852829abb57652d3df97ab5cc2264c756f19d0d7f","vout":1}]' '{"1Ka5jGaok6Ph4JVvmURyAxcmHczhrY3tcn":{"asset_4":1,"":0.2}}' ['']

01000000020ebc397c4750a930829fe34179e6693f41a2e7e77fe0f5c485cd80610e8f0c070000000000ffffffff7f0d9df156c76422ccb57af93d2d6557bb9a825298a034695546153acddb17340100000000ffffffff01002d3101000000003776a914cbb3f02f8d74b3964cc309c2ebfc860ec5cdec1a88ac1c73706b71bb9a825298a034695546153acddb173401000000000000007500000000

signrawtransaction 01000000020ebc397c4750a930829fe34179e6693f41a2e7e77fe0f5c485cd80610e8f0c070000000000ffffffff7f0d9df156c76422ccb57af93d2d6557bb9a825298a034695546153acddb17340100000000ffffffff01002d3101000000003776a914cbb3f02f8d74b3964cc309c2ebfc860ec5cdec1a88ac1c73706b71bb9a825298a034695546153acddb173401000000000000007500000000 "[{\"txid\":\"070c8f0e6180cd85c4f5e07fe7e7a2413f69e67941e39f8230a950477c39bc0e\",\"vout\":0,\"scriptPubKey\":\"76a9144770a681a423cf9f5a1cc5566d20528d0986e0c188ac\",\"redeemScript\":\"\"},{\"txid\":\"3417dbcd3a1546556934a09852829abb57652d3df97ab5cc2264c756f19d0d7f\",\"vout\":1,\"scriptPubKey\":\"76a9144770a681a423cf9f5a1cc5566d20528d0986e0c188ac0c73706b67010000000000000075\",\"redeemScript\":\"\"}]"  "[\"L26q7rA5vE8d65PnpAWrP2qwHN8jYVErMDhv1qdWVhzzYNBx8UwN\"]" ALL


3. sendrawtransaction
I get:
0d3ff5484f08b59ab6adfa63f35384af186a46002b7bb5e08351d6b5ba9a43bf
getrawmempool
{"method":"getrawmempool","params":[],"id":"67905551-1597585139","chain_name":"testnet04"}

[
    "0d3ff5484f08b59ab6adfa63f35384af186a46002b7bb5e08351d6b5ba9a43bf"
]

Of course the transaction stay in the mempool and it is not mined. That is ok, but no UNSIFFICIENT PRIORITY is triggered.

My MC params are the following:

# Native blockchain currency (likely not required)

initial-block-reward = 0                # Initial block mining reward in raw native currency units. (0 - 1000000000000000000)
first-block-reward = 200000000000       # Different mining reward for first block only, ignored if negative. (-1 - 1000000000000000000)
reward-halving-interval = 52560000      # Interval for halving of mining rewards, in blocks. (60 - 1000000000)
reward-spendable-delay = 1              # Delay before mining reward can be spent, in blocks. (1 - 100000)
minimum-per-output = 0                  # Minimum native currency per output (anti-dust), in raw units.
                                        # If set to -1, this is calculated from minimum-relay-fee. (-1 - 1000000000)
maximum-per-output = 200000000000       # Maximum native currency per output, in raw units. (0 - 1000000000000000000)
minimum-offchain-fee = 0                # Minimum fee for publishing off-chain data items, per 1000 bytes, in raw units of native currency. (0 - 1000000000)
minimum-relay-fee = 1000000             # Minimum transaction fee, per 1000 bytes, in raw units of native currency. (0 - 1000000000)
native-currency-multiple = 100000000    # Number of raw units of native currency per display unit. (0 - 1000000000)

Could you kindly explain this?

Thanks,

Fabio

asked Aug 16, 2020 by fabio

1 Answer

0 votes

The sendrawtransaction API is quite low level, so it will not block a transaction with insufficient fees.

Your solution is to check if the fee is appropriate at the application level, by comparing the transaction size (number of hexadecimal characters divided by two) against the fee requires according to the blockchain parameters.

answered Aug 17, 2020 by MultiChain
...