My question has already been asked before, and some answers were also already given the question, however, it's not clear to me why I get some behaviour when implementing it. Here are the details:
I created my transaction and signed it offline, without interacting with bitcoind. But, when I broadcast it to the network (or test acceptability by mempool), it doesn't work unless I import the private key to bitcoind through the rpc command importprivkey.
I inspected the bitcoin code to understand why it does behave like that, but unfortunately, I don't quite understand where it does verify for the private key or check that it was imported. As I understand, the transaction's broadcast happens here sendrawtransaction.
Please, can someone explain why it does happen and/or provide a way to just broadcast raw transactions to the network without importing private keys into bitcoind?