Did not pass filter

+1 vote
root@iZ8vba3a56x4hi6y1glllgZ:/home/mc/multichain-2.0-beta-1# ./multichain-util create c

MultiChain 2.0 beta 1 Utilities (latest protocol 20006)

root@iZ8vba3a56x4hi6y1glllgZ:/home/mc/multichain-2.0-beta-1# ./multichaind c -daemon

root@iZ8vba3a56x4hi6y1glllgZ:/home/mc/multichain-2.0-beta-1# ./multichain-cli c create txfilter filter1 '{}' 'function filtertransaction(){var tx=getfiltertransaction();if (tx.vout.length<=2);return "<<<<<222222";}'
{"method":"create","params":["txfilter","filter1",{},"function filtertransaction(){var tx=getfiltertransaction();if (tx.vout.length<=2);return \"<<<<<222222\";}"],"id":"34131784-1546260530","chain_name":"c"}


root@iZ8vba3a56x4hi6y1glllgZ:/home/mc/multichain-2.0-beta-1# ./multichain-cli c listaddresses

        "address" : "1WqPocUrRwNe6DS1MM9yTUpjSZm8Y2jbmxRP9M",
        "ismine" : true

root@iZ8vba3a56x4hi6y1glllgZ:/home/mc/multichain-2.0-beta-1# ./multichain-cli c  approvefrom 1WqPocUrRwNe6DS1MM9yTUpjSZm8Y2jbmxRP9M filter1 true

error code: -26
error message:
Error: The transaction was rejected: 64: The transaction did not pass filter filter1: <<<<<222222
asked Dec 31, 2018 by mcuser

1 Answer

0 votes

Yes, you cannot approve a filter if the approve transaction itself would not pass that filter. You can think of this as a very basic sanity check that your filter is not rejecting transactions based on unreasonable criteria. An approvefrom transaction does not have more than two outputs.

answered Jan 1, 2019 by MultiChain
But my filter hasn't been used yet. Why was it intercepted when it was approved?
This is just the way the protocol is designed, by choice – a transaction approving a filter has to pass that filter. As I mentioned it's a good sanity check.