Add wtxids to recentRejects instead of txids
Add wtxids to recentRejects instead of txids

Previously, we only added txids to recentRejects if we were sure that the
transaction couldn't have had the wrong witness (either because the witness was
malleated or stripped).

In preparation for wtxid-based relay, we can observe that txid == wtxid for
transactions that have no witness, and add the wtxid of rejected transactions,
provided the transaction wasn't a witness-stripped one. This means that we now
add more data to the filter (as prior to this commit, any transaction with a
witness that failed to be accepted was being skipped for inclusion in the
filter) but witness malleation should still not interfere with relay of a valid
segwit transaction, because the txid of a segwit transaction would not be added
to the filter after failing validation.

In the future, having wtxids in the recent rejects filter will allow us to
skip downloading the same wtxid multiple times, once our peers use wtxids for
transaction relay.

prusnak/bitcoin,mruddy/bitcoin,dscotese/bitcoin,MarcoFalke/bitcoin,apoelstra/bitcoin,ajtowns/bitcoin,prusnak/bitcoin,bitcoin/bitcoin,pstratem/bitcoin,Xekyo/bitcoin,sipsorcery/bitcoin,jambolo/bitcoin,jonasschnelli/bitcoin,instagibbs/bitcoin,bitcoinknots/bitcoin,qtumproject/qtum,rnicoll/bitcoin,domob1812/namecore,sipsorcery/bitcoin,jnewbery/bitcoin,jamesob/bitcoin,cdecker/bitcoin,jnewbery/bitcoin,rnicoll/bitcoin,AkioNak/bitcoin,Xekyo/bitcoin,achow101/bitcoin,mm-s/bitcoin,pataquets/namecoin-core,domob1812/namecore,apoelstra/bitcoin,namecoin/namecoin-core,rnicoll/dogecoin,particl/particl-core,practicalswift/bitcoin,apoelstra/bitcoin,practicalswift/bitcoin,n1bor/bitcoin,jambolo/bitcoin,yenliangl/bitcoin,jambolo/bitcoin,fanquake/bitcoin,namecoin/namecoin-core,jnewbery/bitcoin,EthanHeilman/bitcoin,pataquets/namecoin-core,EthanHeilman/bitcoin,namecoin/namecore,mm-s/bitcoin,alecalve/bitcoin,namecoin/namecoin-core,JeremyRubin/bitcoin,tecnovert/particl-core,mm-s/bitcoin,achow101/bitcoin,jlopp/statoshi,mruddy/bitcoin,andreaskern/bitcoin,namecoin/namecoin-core,bitcoin/bitcoin,andreaskern/bitcoin,fujicoin/fujicoin,litecoin-project/litecoin,lateminer/bitcoin,anditto/bitcoin,MeshCollider/bitcoin,jamesob/bitcoin,achow101/bitcoin,litecoin-project/litecoin,JeremyRubin/bitcoin,andreaskern/bitcoin,MeshCollider/bitcoin,JeremyRubin/bitcoin,bitcoinknots/bitcoin,JeremyRubin/bitcoin,MeshCollider/bitcoin,bitcoinknots/bitcoin,cdecker/bitcoin,anditto/bitcoin,tecnovert/particl-core,sipsorcery/bitcoin,kallewoof/bitcoin,GroestlCoin/GroestlCoin,apoelstra/bitcoin,fanquake/bitcoin,alecalve/bitcoin,achow101/bitcoin,ajtowns/bitcoin,prusnak/bitcoin,n1bor/bitcoin,tecnovert/particl-core,cdecker/bitcoin,n1bor/bitcoin,domob1812/bitcoin,GroestlCoin/bitcoin,sipsorcery/bitcoin,domob1812/bitcoin,JeremyRubin/bitcoin,AkioNak/bitcoin,bitcoin/bitcoin,jnewbery/bitcoin,alecalve/bitcoin,kallewoof/bitcoin,sstone/bitcoin,jamesob/bitcoin,namecoin/namecore,lateminer/bitcoin,EthanHeilman/bitcoin,particl/particl-core,rnicoll/dogecoin,GroestlCoin/GroestlCoin,practicalswift/bitcoin,domob1812/namecore,yenliangl/bitcoin,sstone/bitcoin,MarcoFalke/bitcoin,yenliangl/bitcoin,namecoin/namecore,GroestlCoin/bitcoin,litecoin-project/litecoin,fanquake/bitcoin,jlopp/statoshi,dscotese/bitcoin,bitcoinsSG/bitcoin,dscotese/bitcoin,litecoin-project/litecoin,jambolo/bitcoin,lateminer/bitcoin,jlopp/statoshi,practicalswift/bitcoin,kallewoof/bitcoin,Xekyo/bitcoin,sstone/bitcoin,qtumproject/qtum,lateminer/bitcoin,alecalve/bitcoin,bitcoin/bitcoin,lateminer/bitcoin,sipsorcery/bitcoin,achow101/bitcoin,fanquake/bitcoin,Sjors/bitcoin,sstone/bitcoin,cdecker/bitcoin,ElementsProject/elements,GroestlCoin/bitcoin,fujicoin/fujicoin,bitcoinknots/bitcoin,Sjors/bitcoin,sstone/bitcoin,prusnak/bitcoin,ajtowns/bitcoin,sstone/bitcoin,pataquets/namecoin-core,MeshCollider/bitcoin,ajtowns/bitcoin,jonasschnelli/bitcoin,GroestlCoin/GroestlCoin,GroestlCoin/GroestlCoin,MarcoFalke/bitcoin,yenliangl/bitcoin,EthanHeilman/bitcoin,alecalve/bitcoin,anditto/bitcoin,bitcoin/bitcoin,practicalswift/bitcoin,MarcoFalke/bitcoin,mruddy/bitcoin,apoelstra/bitcoin,ajtowns/bitcoin,JeremyRubin/bitcoin,namecoin/namecoin-core,fujicoin/fujicoin,tecnovert/particl-core,andreaskern/bitcoin,practicalswift/bitcoin,tecnovert/particl-core,alecalve/bitcoin,ElementsProject/elements,litecoin-project/litecoin,Xekyo/bitcoin,kallewoof/bitcoin,namecoin/namecore,particl/particl-core,bitcoinsSG/bitcoin,GroestlCoin/bitcoin,qtumproject/qtum,domob1812/namecore,domob1812/bitcoin,bitcoinsSG/bitcoin,bitcoinknots/bitcoin,qtumproject/qtum,dscotese/bitcoin,pstratem/bitcoin,bitcoinsSG/bitcoin,mm-s/bitcoin,GroestlCoin/bitcoin,achow101/bitcoin,jambolo/bitcoin,namecoin/namecoin-core,litecoin-project/litecoin,tecnovert/particl-core,GroestlCoin/GroestlCoin,anditto/bitcoin,AkioNak/bitcoin,andreaskern/bitcoin,jonasschnelli/bitcoin,fanquake/bitcoin,kallewoof/bitcoin,rnicoll/bitcoin,pataquets/namecoin-core,GroestlCoin/GroestlCoin,instagibbs/bitcoin,lateminer/bitcoin,rnicoll/dogecoin,jamesob/bitcoin,domob1812/namecore,bitcoinsSG/bitcoin,instagibbs/bitcoin,namecoin/namecore,namecoin/namecore,Sjors/bitcoin,EthanHeilman/bitcoin,EthanHeilman/bitcoin,instagibbs/bitcoin,pstratem/bitcoin,dscotese/bitcoin,GroestlCoin/bitcoin,AkioNak/bitcoin,jonasschnelli/bitcoin,domob1812/bitcoin,AkioNak/bitcoin,ajtowns/bitcoin,jlopp/statoshi,bitcoinsSG/bitcoin,pataquets/namecoin-core,Xekyo/bitcoin,ElementsProject/elements,qtumproject/qtum,mruddy/bitcoin,pataquets/namecoin-core,mm-s/bitcoin,Sjors/bitcoin,Sjors/bitcoin,AkioNak/bitcoin,yenliangl/bitcoin,mm-s/bitcoin,n1bor/bitcoin,fujicoin/fujicoin,prusnak/bitcoin,kallewoof/bitcoin,mruddy/bitcoin,jlopp/statoshi,MarcoFalke/bitcoin,jamesob/bitcoin,andreaskern/bitcoin,domob1812/bitcoin,instagibbs/bitcoin,MeshCollider/bitcoin,rnicoll/bitcoin,rnicoll/dogecoin,pstratem/bitcoin,qtumproject/qtum,ElementsProject/elements,prusnak/bitcoin,n1bor/bitcoin,qtumproject/qtum,jlopp/statoshi,Xekyo/bitcoin,fujicoin/fujicoin,apoelstra/bitcoin,jnewbery/bitcoin,jambolo/bitcoin,yenliangl/bitcoin,rnicoll/bitcoin,bitcoin/bitcoin,ElementsProject/elements,pstratem/bitcoin,jamesob/bitcoin,ElementsProject/elements,domob1812/namecore,anditto/bitcoin,cdecker/bitcoin,anditto/bitcoin,jonasschnelli/bitcoin,MeshCollider/bitcoin,n1bor/bitcoin,fujicoin/fujicoin,domob1812/bitcoin,instagibbs/bitcoin,mruddy/bitcoin,fanquake/bitcoin,rnicoll/bitcoin,particl/particl-core,cdecker/bitcoin,pstratem/bitcoin,particl/particl-core,dscotese/bitcoin,rnicoll/dogecoin,MarcoFalke/bitcoin,particl/particl-core,sipsorcery/bitcoin