Hi team (possible this is a duplication, as previous one I asked w/o being a member, sr for any inconvenience),
I've been trying to test the latest tx filters by using this script to limit asset for USD, but I had some issues, as below:
- The filter actually filtered out the tx in the strange behaviour, as given, if value > 1000 it will be error, but even when I put 100 or 500, it also rejected the tx
- When I approved the tx filters, the blockchain stopped producing new blocks (check with block height), all attempts to start again the chain are not successful
Here are the commands I've used:
multichain-cli test1 issuefrom 1Cr6VxbSQ5TMfegbUSgY4t1F2ing2QH2yVLgAd 1Cr6VxbSQ5TMfegbUSgY4t1F2ing2QH2yVLgAd '{"name":"USD","open":true}' 50000 0.01 0 '{"origin":"us", "stage":"01", "purpose":"parts prepayment"}' multichain-cli test1 sendasset 1bND5DeePFNmrWBoeaVn4z6WJiYSQv9jMwSwY7 USD 3000 multichain-cli test1 create txfilter testfilter '{"for":"USD"}' 'function outputtoaddressbalancechange(output, spent, addressbalancechange) { if (output.assets) { for (var assetnum=0; assetnum<output.assets.length; assetnum++) { if (output.assets[assetnum].name=="USD") { for (var addressnum=0; addressnum<output.scriptPubKey.addresses.length; addressnum++) { var address=output.scriptPubKey.addresses[addressnum]; if (!addressbalancechange.hasOwnProperty(address)) addressbalancechange[address]=0; var rawchange=spent ? -output.assets[assetnum].raw : output.assets[assetnum].raw; addressbalancechange[address]+=rawchange; } } } } } function filtertransaction() { var tx=getfiltertransaction(); var addressbalancechange={}; for (var inputnum=0; inputnum<tx.vin.length; inputnum++) { outputtoaddressbalancechange(getfiltertxinput(inputnum), true, addressbalancechange); } for (var outputnum=0; outputnum<tx.vout.length; outputnum++) { outputtoaddressbalancechange(tx.vout[outputnum], false, addressbalancechange); } for (var address in addressbalancechange) if (addressbalancechange[address]>1000) return "Address "+address+" is receiving too much USD"; }' multichain-cli test1 approvefrom 1bND5DeePFNmrWBoeaVn4z6WJiYSQv9jMwSwY7 testfilter true |
Do you have any reasons for the strange behavior from the chain?
Thank you for your support,
Best,