It was the Bitcointalk forum that inspired us to create Bitcointalksearch.org - Bitcointalk is an excellent site that should be the default page for anybody dealing in cryptocurrency, since it is a virtual gold-mine of data. However, our experience and user feedback led us create our site; Bitcointalk's search is slow, and difficult to get the results you need, because you need to log in first to find anything useful - furthermore, there are rate limiters for their search functionality.
The aim of our project is to create a faster website that yields more results and faster without having to create an account and eliminate the need to log in - your personal data, therefore, will never be in jeopardy since we are not asking for any of your data and you don't need to provide them to use our site with all of its capabilities.
We created this website with the sole purpose of users being able to search quickly and efficiently in the field of cryptocurrency so they will have access to the latest and most accurate information and thereby assisting the crypto-community at large.
import bitcoin.rpc
bitcoin_url = "http://username:password@localhost:8332" #tu mets ton noeud BitcoinCore ici
proxy = bitcoin.rpc.Proxy(bitcoin_url)
def forward_payments():
address1 = "Adresse_cible"
address2 = "Adresse_destination"
unspent = proxy.listunspent(1, 9999999, [adresse_cible]) #Obtenir les tx non spent de BTC sur l'adresse cible
inputs = [{"txid": u["txid"], "vout": u["vout"]} for u in unspent] #Créée une liste d'entrées pour les transactions non dépensées
outputs = {adresse_destination: sum([u["amount"] for u in unspent])} #Créée une sortie unique qui envoie tous les fonds à l'adresse de destination
tx = proxy.createrawtransaction(inputs, outputs) #Créée la transaction brute
signed = proxy.signrawtransaction(tx)["hex"] #Signe la transaction brute avec la clé privée associée à l'adresse cible
txid = proxy.sendrawtransaction(signed) #Envoie la transaction signée sur le réseau Bitcoin
print(f"Forwarded {sum([u['amount'] for u in unspent])} BTC from {adresse_cible} to {adresse_destination} with transaction ID {txid}")
if __name__ == "__main__":
forward_payments()